Skip to content

Commit 3d8b368

Browse files
committed
scrapyd: use runner from config (if not specified) on get_spider_list()
1 parent fa644f7 commit 3d8b368

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scrapyd/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from scrapy.spiderqueue import SqliteSpiderQueue
77
from scrapy.utils.python import stringify_dict, unicode_to_str
8+
from scrapyd.config import Config
89

910
def get_spider_queues(config):
1011
"""Return a dict of Spider Quees keyed by project name"""
@@ -44,8 +45,10 @@ def get_crawl_args(message):
4445
args += ['%s=%s' % (k, v)]
4546
return args
4647

47-
def get_spider_list(project, runner='scrapyd.runner'):
48+
def get_spider_list(project, runner=None):
4849
"""Return the spider list from the given project, using the given runner"""
50+
if runner is None:
51+
runner = Config().get('runner')
4952
env = os.environ.copy()
5053
env['SCRAPY_PROJECT'] = project
5154
pargs = [sys.executable, '-m', runner, 'list']

0 commit comments

Comments
 (0)