def _check_deprecated_scrapy_ctl(argv, inproject):
 if (not any((('scrapy-ctl' in x) for x in argv))):
  return
 import warnings
 warnings.warn('`scrapy-ctl.py` command-line tool is deprecated and will be removed in Scrapy 0.11, use `scrapy` instead', ScrapyDeprecationWarning, stacklevel=3)
 if inproject:
  projpath = os.path.abspath(os.path.dirname(os.path.dirname(settings.settings_module.__file__)))
  cfg_path = os.path.join(projpath, 'scrapy.cfg')
  if (not os.path.exists(cfg_path)):
   with open(cfg_path, 'w') as f:
    f.write(('# generated automatically - feel free to edit' + os.linesep))
    f.write(('[settings]' + os.linesep))
    f.write((('default = %s' % settings.settings_module.__name__) + os.linesep))

def _check_deprecated_scrapy_ctl ( argv , inproject ) : if ( not any ( ( ( 'scrapy-ctl' in x ) for x in argv ) ) ) : return import warnings warnings . warn ( '`scrapy-ctl.py` command-line tool is deprecated and will be removed in Scrapy 0.11, use `scrapy` instead' , ScrapyDeprecationWarning , stacklevel = 3 ) if inproject : projpath = os . path . abspath ( os . path . dirname ( os . path . dirname ( settings . settings_module . __file__ ) ) ) cfg_path = os . path . join ( projpath , 'scrapy.cfg' ) if ( not os . path . exists ( cfg_path ) ) : with open ( cfg_path , 'w' ) as f : f . write ( ( '# generated automatically - feel free to edit' + os . linesep ) ) f . write ( ( '[settings]' + os . linesep ) ) f . write ( ( ( 'default = %s' % settings . settings_module . __name__ ) + os . linesep ) )
check if scrapy was called using the deprecated scrapy-ctl command and warn in that case .