Skip to content

Commit b435a35

Browse files
author
Taois
committed
fix: init bug
1 parent 8542367 commit b435a35

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/pyenv.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# 安装python环境依赖
22

33
```shell
4-
pip install -r spider/py/base/requirements.txt
4+
# windows
5+
pip install -r spider/py/base/requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple
6+
# linux
7+
pip3 install -r spider/py/base/requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple
58
```

spider/py/_bridge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ def call_spider_method(spider, method_name, args):
9191
print(f'parsed_args:{parsed_args}')
9292

9393
if method_name == 'init':
94-
spider, result = t4_spider_init(spider, *parsed_args)
94+
extend = parsed_args[0] if parsed_args else ''
95+
spider, result = t4_spider_init(spider, extend)
9596
# result = spider.init(modules)
9697
return result
9798
else:
9899
if not hasattr(spider, '_init_ok_'):
99100
# spider,_ = t4_spider_init(spider,*parsed_args) # 需要传extend参数,暂时没有好办法
100-
spider, _ = t4_spider_init(spider, *parsed_args)
101+
extend = parsed_args[0] if parsed_args else ''
102+
spider, _ = t4_spider_init(spider, extend)
101103
method = getattr(spider, invoke_method_name)
102104
result = method(*parsed_args)
103105
# 返回结果

0 commit comments

Comments
 (0)