From f1356bb3246ecc17a6be0448eb45cccce5940cf9 Mon Sep 17 00:00:00 2001 From: g1879 Date: Fri, 22 May 2020 15:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=B7=E8=B1=A1=E8=BF=90?= =?UTF-8?q?=E7=AE=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/common.py | 4 +++- README.md | 4 +++- setup.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DrissionPage/common.py b/DrissionPage/common.py index 6abab86..4f50e68 100644 --- a/DrissionPage/common.py +++ b/DrissionPage/common.py @@ -125,7 +125,8 @@ def avoid_duplicate_name(folder_path: str, file_name: str) -> str: :param file_name: 要检查的文件名 :return: 可用的文件名 """ - while (file_Path := Path(folder_path).joinpath(file_name)).exists(): + file_Path = Path(folder_path).joinpath(file_name) + while file_Path.exists(): ext_name = file_Path.suffix base_name = file_Path.stem num = base_name.split(' ')[-1] @@ -134,4 +135,5 @@ def avoid_duplicate_name(folder_path: str, file_name: str) -> str: file_name = f'{base_name.replace(f"({num})", "", -1)}({num + 1}){ext_name}' else: file_name = f'{base_name} (1){ext_name}' + file_Path = Path(folder_path).joinpath(file_name) return file_name diff --git a/README.md b/README.md index d2916d1..bd3f0d0 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ DrissionPage,即driver和session的合体。 - https://github.com/g1879/DrissionPage - https://gitee.com/g1879/DrissionPage -**联系邮箱:**g1879@qq.com +**联系邮箱:** g1879@qq.com # 特性 @@ -243,6 +243,8 @@ element.location # 元素位置 因chrome和headers配置繁多,故设置一个ini文件专门用于保存常用配置,你可使用OptionsManager对象获取和保存配置,用DriverOptions对象修改chrome配置。你也可以保存多个ini文件,按不同项目须要调用。 +注:建议把常用配置文件保存到别的路径,以防本库升级时配置被重置。 + ### ini文件内容 ini文件默认拥有三部分配置:paths、chrome_options、session_options,初始内容如下。 diff --git a/setup.py b/setup.py index 8b66346..170bc96 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open("README.md", "r", encoding='utf-8') as fh: setup( name="DrissionPage", - version="0.8.0", + version="0.8.3", author="g1879", author_email="g1879@qq.com", description="A module that integrates selenium and requests session, encapsulates common page operations.", @@ -17,6 +17,7 @@ setup( license="BSD", keywords="DrissionPage", url="https://github.com/g1879/DrissionPage", + include_package_data=True, packages=find_packages(), install_requires=[ "selenium", @@ -30,4 +31,5 @@ setup( "Topic :: Utilities", "License :: OSI Approved :: BSD License", ], + python_requires='>=3.6' )