def get_spider_list(project, runner=None, pythonpath=None, version=''):
 if ('cache' not in get_spider_list.__dict__):
  get_spider_list.cache = UtilsCache()
 try:
  return get_spider_list.cache[project][version]
 except KeyError:
  pass
 if (runner is None):
  runner = Config().get('runner')
 env = os.environ.copy()
 env['PYTHONIOENCODING'] = 'UTF-8'
 env['SCRAPY_PROJECT'] = project
 if pythonpath:
  env['PYTHONPATH'] = pythonpath
 if version:
  env['SCRAPY_EGG_VERSION'] = version
 pargs = [sys.executable, '-m', runner, 'list']
 proc = Popen(pargs, stdout=PIPE, stderr=PIPE, env=env)
 (out, err) = proc.communicate()
 if proc.returncode:
  msg = (err or out or '')
  msg = msg.decode('utf8')
  raise RuntimeError((msg.encode('unicode_escape') if six.PY2 else msg))
 tmp = out.decode('utf-8').splitlines()
 try:
  project_cache = get_spider_list.cache[project]
  project_cache[version] = tmp
 except KeyError:
  project_cache = {version: tmp}
 get_spider_list.cache[project] = project_cache
 return tmp

def get_spider_list ( project , runner = None , pythonpath = None , version = '' ) : if ( 'cache' not in get_spider_list . __dict__ ) : get_spider_list . cache = UtilsCache ( ) try : return get_spider_list . cache [ project ] [ version ] except KeyError : pass if ( runner is None ) : runner = Config ( ) . get ( 'runner' ) env = os . environ . copy ( ) env [ 'PYTHONIOENCODING' ] = 'UTF-8' env [ 'SCRAPY_PROJECT' ] = project if pythonpath : env [ 'PYTHONPATH' ] = pythonpath if version : env [ 'SCRAPY_EGG_VERSION' ] = version pargs = [ sys . executable , '-m' , runner , 'list' ] proc = Popen ( pargs , stdout = PIPE , stderr = PIPE , env = env ) ( out , err ) = proc . communicate ( ) if proc . returncode : msg = ( err or out or '' ) msg = msg . decode ( 'utf8' ) raise RuntimeError ( ( msg . encode ( 'unicode_escape' ) if six . PY2 else msg ) ) tmp = out . decode ( 'utf-8' ) . splitlines ( ) try : project_cache = get_spider_list . cache [ project ] project_cache [ version ] = tmp except KeyError : project_cache = { version : tmp } get_spider_list . cache [ project ] = project_cache return tmp
return the spider list from the given project .