def iter_spider_classes(module):
 from scrapy.spider import BaseSpider
 for obj in vars(module).itervalues():
  if (inspect.isclass(obj) and issubclass(obj, BaseSpider) and (obj.__module__ == module.__name__) and getattr(obj, 'name', None)):
   (yield obj)

def iter_spider_classes ( module ) : from scrapy . spider import BaseSpider for obj in vars ( module ) . itervalues ( ) : if ( inspect . isclass ( obj ) and issubclass ( obj , BaseSpider ) and ( obj . __module__ == module . __name__ ) and getattr ( obj , 'name' , None ) ) : ( yield obj )
return an iterator over all spider classes defined in the given module that can be instantiated .