Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

scrapyd: use runner from config (if not specified) on get_spider_list()

Pablo Hoffman3d8b368fc642
diff --git a/scrapyd/utils.py b/scrapyd/utils.py
index 6a670377c..c100d9833 100644
--- a/scrapyd/utils.py
+++ b/scrapyd/utils.py
@@ -5,6 +5,7 @@ from ConfigParser import NoSectionError
from scrapy.spiderqueue import SqliteSpiderQueue
from scrapy.utils.python import stringify_dict, unicode_to_str
+from scrapyd.config import Config
def get_spider_queues(config):
"""Return a dict of Spider Quees keyed by project name"""
@@ -44,8 +45,10 @@ def get_crawl_args(message):
args += ['%s=%s' % (k, v)]
return args
-def get_spider_list(project, runner='scrapyd.runner'):
+def get_spider_list(project, runner=None):
"""Return the spider list from the given project, using the given runner"""
+ if runner is None:
+ runner = Config().get('runner')
env = os.environ.copy()
env['SCRAPY_PROJECT'] = project
pargs = [sys.executable, '-m', runner, 'list']