def closest_scrapy_cfg(path='.', prevpath=None):
 if (path == prevpath):
  return ''
 path = os.path.abspath(path)
 cfgfile = os.path.join(path, 'scrapy.cfg')
 if os.path.exists(cfgfile):
  return cfgfile
 return closest_scrapy_cfg(os.path.dirname(path), path)

def closest_scrapy_cfg ( path = '.' , prevpath = None ) : if ( path == prevpath ) : return '' path = os . path . abspath ( path ) cfgfile = os . path . join ( path , 'scrapy.cfg' ) if os . path . exists ( cfgfile ) : return cfgfile return closest_scrapy_cfg ( os . path . dirname ( path ) , path )
return the path to the closest scrapy .