def activate_egg(eggpath):
 try:
  d = next(pkg_resources.find_distributions(eggpath))
 except StopIteration:
  raise ValueError('Unknown or corrupt egg')
 d.activate()
 settings_module = d.get_entry_info('scrapy', 'settings').module_name
 os.environ.setdefault('SCRAPY_SETTINGS_MODULE', settings_module)

def activate_egg ( eggpath ) : try : d = next ( pkg_resources . find_distributions ( eggpath ) ) except StopIteration : raise ValueError ( 'Unknown or corrupt egg' ) d . activate ( ) settings_module = d . get_entry_info ( 'scrapy' , 'settings' ) . module_name os . environ . setdefault ( 'SCRAPY_SETTINGS_MODULE' , settings_module )
activate a scrapy egg file .