feat: support DrissionPage CLI

This commit is contained in:
zhiheng.hu 2023-02-16 11:37:22 +08:00
parent 81b5827438
commit b8392817fa
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',
],
},
)