coocan 0.4.8__tar.gz → 0.5.1__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.8 → coocan-0.5.1}/PKG-INFO +4 -1
- {coocan-0.4.8 → coocan-0.5.1}/coocan/cmd/cli.py +5 -5
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/PKG-INFO +4 -1
- {coocan-0.4.8 → coocan-0.5.1}/setup.py +1 -1
- {coocan-0.4.8 → coocan-0.5.1}/README.md +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/__init__.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/cmd/__init__.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/gen.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/spider/__init__.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/spider/base.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/templates/spider.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/url/__init__.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/url/request.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan/url/response.py +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/SOURCES.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/dependency_links.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/entry_points.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/requires.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/coocan.egg-info/top_level.txt +0 -0
- {coocan-0.4.8 → coocan-0.5.1}/setup.cfg +0 -0
@@ -1,11 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: coocan
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.1
|
4
4
|
Summary: Air Spider Framework
|
5
5
|
Author: wauo
|
6
6
|
Author-email: markadc@126.com
|
7
7
|
Requires-Python: >=3.10
|
8
8
|
Description-Content-Type: text/markdown
|
9
|
+
Requires-Dist: click>=8.0.0
|
10
|
+
Requires-Dist: httpx
|
11
|
+
Requires-Dist: loguru
|
9
12
|
|
10
13
|
# 项目说明
|
11
14
|
|
@@ -37,21 +37,21 @@ def main(ctx):
|
|
37
37
|
|
38
38
|
@main.command()
|
39
39
|
@click.option('-s', '--spider', required=True, help='爬虫文件名字')
|
40
|
-
def new(spider):
|
40
|
+
def new(spider: str):
|
41
41
|
"""新建"""
|
42
42
|
if not re.search("^[a-zA-Z0-9_]*$", spider):
|
43
43
|
click.echo("只支持字母、数字、下划线")
|
44
44
|
return
|
45
45
|
|
46
|
-
|
47
|
-
if not
|
48
|
-
|
46
|
+
spider_class_name = snake_to_pascal(spider)
|
47
|
+
if not spider_class_name.lower().endswith("spider"):
|
48
|
+
spider_class_name += "Spider"
|
49
49
|
|
50
50
|
try:
|
51
51
|
template_path = TEMPLATE_DIR / "spider.txt"
|
52
52
|
with open(template_path, 'r') as f:
|
53
53
|
text = f.read()
|
54
|
-
spider_py_text = text.replace("{SpiderClassName}",
|
54
|
+
spider_py_text = text.replace("{SpiderClassName}", spider_class_name)
|
55
55
|
|
56
56
|
py_file = "{}.py".format(spider)
|
57
57
|
if os.path.exists(py_file):
|
@@ -1,11 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: coocan
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.1
|
4
4
|
Summary: Air Spider Framework
|
5
5
|
Author: wauo
|
6
6
|
Author-email: markadc@126.com
|
7
7
|
Requires-Python: >=3.10
|
8
8
|
Description-Content-Type: text/markdown
|
9
|
+
Requires-Dist: click>=8.0.0
|
10
|
+
Requires-Dist: httpx
|
11
|
+
Requires-Dist: loguru
|
9
12
|
|
10
13
|
# 项目说明
|
11
14
|
|
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
|
File without changes
|