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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: coocan
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Air Spider Framework
5
5
  Author: wauo
6
6
  Author-email: markadc@126.com
@@ -5,12 +5,24 @@ import click
5
5
  TEMPLATE_DIR = Path(__file__).parent / "templates"
6
6
 
7
7
 
8
- @click.command()
9
- @click.option('-s', '--spider', required=True, help='新建爬虫')
10
- def main(spider):
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 Create Spider {}".format(spider_file_name))
33
+ click.echo("Success")
22
34
 
23
35
  except Exception as e:
24
36
  click.echo(str(e))
25
- raise click.ClickException("Failed Create Spider {}".format(spider_file_name))
37
+ raise click.ClickException("Failed")
26
38
 
27
39
 
28
40
  if __name__ == '__main__':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: coocan
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Air Spider Framework
5
5
  Author: wauo
6
6
  Author-email: markadc@126.com
@@ -1 +1,3 @@
1
1
  click>=8.0.0
2
+ httpx
3
+ loguru
@@ -2,14 +2,14 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="coocan",
5
- version="0.4.3",
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