coocan 0.4.3__tar.gz → 0.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coocan-0.4.3 → coocan-0.4.5}/PKG-INFO +1 -1
- {coocan-0.4.3 → coocan-0.4.5}/coocan/cmd/cli.py +18 -6
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/PKG-INFO +1 -1
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/requires.txt +2 -0
- {coocan-0.4.3 → coocan-0.4.5}/setup.py +2 -2
- {coocan-0.4.3 → coocan-0.4.5}/coocan/__init__.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/cmd/__init__.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/cmd/templates/__init__.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/cmd/templates/spider.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/gen.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/spider/__init__.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/spider/base.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/url/__init__.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/url/request.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan/url/response.py +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/SOURCES.txt +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/dependency_links.txt +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/entry_points.txt +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/coocan.egg-info/top_level.txt +0 -0
- {coocan-0.4.3 → coocan-0.4.5}/setup.cfg +0 -0
@@ -5,12 +5,24 @@ import click
|
|
5
5
|
TEMPLATE_DIR = Path(__file__).parent / "templates"
|
6
6
|
|
7
7
|
|
8
|
-
@click.
|
9
|
-
|
10
|
-
|
8
|
+
@click.group()
|
9
|
+
def main():
|
10
|
+
"""
|
11
|
+
\n
|
12
|
+
可用命令:
|
13
|
+
new - 创建新的爬虫文件
|
14
|
+
\n
|
15
|
+
示例:
|
16
|
+
cc new -s demo
|
17
|
+
"""
|
18
|
+
|
19
|
+
|
20
|
+
@main.command()
|
21
|
+
@click.option('-s', '--spider', required=True, help='爬虫文件')
|
22
|
+
def new(spider):
|
23
|
+
"""新建"""
|
11
24
|
spider_file_name = "{}.py".format(spider)
|
12
25
|
try:
|
13
|
-
|
14
26
|
template_path = TEMPLATE_DIR / "spider.py"
|
15
27
|
with open(template_path, 'r') as f:
|
16
28
|
content = f.read()
|
@@ -18,11 +30,11 @@ def main(spider):
|
|
18
30
|
with open(spider_file_name, 'w') as f:
|
19
31
|
f.write(content)
|
20
32
|
|
21
|
-
click.echo("Success
|
33
|
+
click.echo("Success")
|
22
34
|
|
23
35
|
except Exception as e:
|
24
36
|
click.echo(str(e))
|
25
|
-
raise click.ClickException("Failed
|
37
|
+
raise click.ClickException("Failed")
|
26
38
|
|
27
39
|
|
28
40
|
if __name__ == '__main__':
|
@@ -2,14 +2,14 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="coocan",
|
5
|
-
version="0.4.
|
5
|
+
version="0.4.5",
|
6
6
|
author="wauo",
|
7
7
|
author_email="markadc@126.com",
|
8
8
|
description="Air Spider Framework",
|
9
9
|
packages=find_packages(),
|
10
10
|
python_requires=">=3.10",
|
11
11
|
install_requires=[
|
12
|
-
'click>=8.0.0',
|
12
|
+
'click>=8.0.0', 'httpx', 'loguru'
|
13
13
|
],
|
14
14
|
entry_points={
|
15
15
|
'console_scripts': [
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|