!17 支持 DrissonPage CLI 命令行工具

Merge pull request !17 from 虫师/master
This commit is contained in:
g1879 2023-02-16 03:45:31 +00:00 committed by Gitee
commit 1fccb9eeb8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 2 deletions

15
DrissionPage/cli.py Normal file
View File

@ -0,0 +1,15 @@
import click
from DrissionPage.easy_set import set_paths
@click.command()
@click.option("-p", "--browser-path", help="Setting browser path.")
def main(browser_path):
"""DrissionPage CLI."""
if browser_path:
set_paths(browser_path=browser_path)
return 0
if __name__ == '__main__':
main()

View File

@ -17,6 +17,7 @@ setup(
url="https://gitee.com/g1879/DrissionPage",
include_package_data=True,
packages=find_packages(),
zip_safe=False,
install_requires=[
"selenium",
"lxml",
@ -24,7 +25,8 @@ setup(
"requests",
"DownloadKit>=0.5.0",
"FlowViewer",
"websocket-client"
"websocket-client",
'click~=8.1.3'
],
classifiers=[
"Programming Language :: Python :: 3.6",
@ -32,5 +34,10 @@ setup(
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
python_requires='>=3.6'
python_requires='>=3.6',
entry_points={
'console_scripts': [
'dp = DrissionPage.cli:main',
],
},
)