crawlo 1.2.1__py3-none-any.whl → 1.2.2__py3-none-any.whl
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.
Potentially problematic release.
This version of crawlo might be problematic. Click here for more details.
- crawlo/__version__.py +1 -1
- crawlo/cli.py +16 -0
- crawlo/commands/help.py +4 -4
- {crawlo-1.2.1.dist-info → crawlo-1.2.2.dist-info}/METADATA +1 -1
- {crawlo-1.2.1.dist-info → crawlo-1.2.2.dist-info}/RECORD +8 -8
- {crawlo-1.2.1.dist-info → crawlo-1.2.2.dist-info}/WHEEL +0 -0
- {crawlo-1.2.1.dist-info → crawlo-1.2.2.dist-info}/entry_points.txt +0 -0
- {crawlo-1.2.1.dist-info → crawlo-1.2.2.dist-info}/top_level.txt +0 -0
crawlo/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.2"
|
crawlo/cli.py
CHANGED
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
# -*- coding: UTF-8 -*-
|
|
4
4
|
import sys
|
|
5
5
|
import argparse
|
|
6
|
+
import os
|
|
6
7
|
from crawlo.commands import get_commands
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def main():
|
|
11
|
+
# 获取框架版本号
|
|
12
|
+
version_file = os.path.join(os.path.dirname(__file__), '__version__.py')
|
|
13
|
+
if os.path.exists(version_file):
|
|
14
|
+
with open(version_file, 'r') as f:
|
|
15
|
+
exec(f.read())
|
|
16
|
+
VERSION = locals().get('__version__', '1.0.0')
|
|
17
|
+
else:
|
|
18
|
+
VERSION = '1.0.0'
|
|
19
|
+
|
|
10
20
|
# 获取所有可用命令
|
|
11
21
|
commands = get_commands()
|
|
12
22
|
|
|
@@ -19,11 +29,17 @@ def main():
|
|
|
19
29
|
|
|
20
30
|
# 添加帮助参数
|
|
21
31
|
parser.add_argument('-h', '--help', action='store_true', help='显示帮助信息')
|
|
32
|
+
parser.add_argument('-v', '--version', action='store_true', help='显示版本信息')
|
|
22
33
|
parser.add_argument('command', nargs='?', help='可用命令: ' + ', '.join(commands.keys()))
|
|
23
34
|
|
|
24
35
|
# 解析已知参数
|
|
25
36
|
args, unknown = parser.parse_known_args()
|
|
26
37
|
|
|
38
|
+
# 处理版本参数
|
|
39
|
+
if args.version:
|
|
40
|
+
print(f"Crawlo {VERSION}")
|
|
41
|
+
sys.exit(0)
|
|
42
|
+
|
|
27
43
|
# 处理帮助参数
|
|
28
44
|
if args.help or (args.command is None and not unknown):
|
|
29
45
|
# 导入并运行帮助命令
|
crawlo/commands/help.py
CHANGED
|
@@ -137,7 +137,7 @@ def show_help():
|
|
|
137
137
|
console.print()
|
|
138
138
|
|
|
139
139
|
# 显示更多信息
|
|
140
|
-
console.print("[bold green]更多信息:[/bold green]")
|
|
141
|
-
console.print(" 文档: https://crawlo.readthedocs.io/")
|
|
142
|
-
console.print(" 源码: https://github.com/crawl-coder/Crawlo")
|
|
143
|
-
console.print(" 问题: https://github.com/crawl-coder/Crawlo/issues")
|
|
140
|
+
# console.print("[bold green]更多信息:[/bold green]")
|
|
141
|
+
# console.print(" 文档: https://crawlo.readthedocs.io/")
|
|
142
|
+
# console.print(" 源码: https://github.com/crawl-coder/Crawlo")
|
|
143
|
+
# console.print(" 问题: https://github.com/crawl-coder/Crawlo/issues")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
crawlo/__init__.py,sha256=jSOsZbDJ_Q5wZV8onSXx5LgNM7Z1q3zCROGdImBDr2I,1373
|
|
2
|
-
crawlo/__version__.py,sha256=
|
|
3
|
-
crawlo/cli.py,sha256=
|
|
2
|
+
crawlo/__version__.py,sha256=ZQHRX6XTb8PHUxt2yUXlITCSopFOjlI8X1fch8t4uA8,23
|
|
3
|
+
crawlo/cli.py,sha256=DQIS3qIqLvQk_RVBc1j52to4QULfkq3DKK0fpNdiQ9k,2617
|
|
4
4
|
crawlo/config.py,sha256=_pORwcVEgjEhrqVaApu51X0Il3TBK6w9aezGnnqYu8Y,9847
|
|
5
5
|
crawlo/config_validator.py,sha256=M118EATR-tITzRSe2oSinV5oh2QsooMCkEJ5WS8ma_0,10155
|
|
6
6
|
crawlo/crawler.py,sha256=24EE7zFPByeYLJnf1K_R9fhJMqaFUjBSa6TuUhlY4TI,37398
|
|
@@ -18,7 +18,7 @@ crawlo/cleaners/text_cleaner.py,sha256=16e6WqIIb9qANMiK-vCEl4TvgkId19Aa2W1NMLU-j
|
|
|
18
18
|
crawlo/commands/__init__.py,sha256=orvY6wLOBwGUEJKeF3h_T1fxj8AaQLjngBDd-3xKOE4,392
|
|
19
19
|
crawlo/commands/check.py,sha256=jW8SgfkOS35j4VS7nRZBZdFCBX9CVFez5LR2sfP_H1U,23437
|
|
20
20
|
crawlo/commands/genspider.py,sha256=_3GwFMYK79BuKk__5L0ljuwWwOzN80MeuhRkL4Ql11A,5201
|
|
21
|
-
crawlo/commands/help.py,sha256
|
|
21
|
+
crawlo/commands/help.py,sha256=-bQRaGiV0tw4FKURDY2OXeQQuHGGlq6uzYJQ0tHB20w,5322
|
|
22
22
|
crawlo/commands/list.py,sha256=octTk0QZhapiyM7WgCPersP2v3MesthbJeG9vMqVFOs,5936
|
|
23
23
|
crawlo/commands/run.py,sha256=Go9hAEUMuG3GphBgemG5S5W4MF39XOxp7-E06rX-pTU,11043
|
|
24
24
|
crawlo/commands/startproject.py,sha256=UYGelGY4dM6Zu3U4G5m8snKqbsfgszhvfpAJLl5b5tM,15772
|
|
@@ -213,8 +213,8 @@ tests/test_template_content.py,sha256=URwjlAzMCdUN0sW_OupUcuSNMxp1OKgW79JOpkLPXn
|
|
|
213
213
|
tests/test_template_redis_key.py,sha256=dOFutic8CL3tOzGbYhWbMrYiXZ8R3fhNoF5VKax5Iy0,4946
|
|
214
214
|
tests/test_tools.py,sha256=fgzXL2L7eBV_nGjeMxH8IMhfc0dviQ80XgzZkJp_4dA,5266
|
|
215
215
|
tests/tools_example.py,sha256=uXNS4xXJ-OD_xInAn2zjKLG_nlbgVGXZLoJtfhaG9lI,7926
|
|
216
|
-
crawlo-1.2.
|
|
217
|
-
crawlo-1.2.
|
|
218
|
-
crawlo-1.2.
|
|
219
|
-
crawlo-1.2.
|
|
220
|
-
crawlo-1.2.
|
|
216
|
+
crawlo-1.2.2.dist-info/METADATA,sha256=Kd8W53gp0eac7V4kT-IGgdpQ68iHd22tmiV4En9v8xs,20484
|
|
217
|
+
crawlo-1.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
218
|
+
crawlo-1.2.2.dist-info/entry_points.txt,sha256=5HoVoTSPxI8SCa5B7pQYxLSrkOdiunyO9tqNsLMv52g,43
|
|
219
|
+
crawlo-1.2.2.dist-info/top_level.txt,sha256=keG_67pbZ_wZL2dmDRA9RMaNHTaV_x_oxZ9DKNgwvR0,22
|
|
220
|
+
crawlo-1.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|