Example #1
0
	def from_crawler(cls, crawler):	  
		obj = cls(crawler.settings, crawler.stats, crawler)
		crawler.signals.connect(obj.spider_opened, signals.spider_opened)
		crawler.signals.connect(obj.spider_closed, signals.spider_closed)
		crawler.signals.connect(obj.proxies.spider_opened, signals.spider_opened)	
		crawler.signals.connect(obj.proxies.spider_closed, signals.spider_closed)	
		crawler.proxies = obj
		return add_downloadmw_to_crawler(obj,crawler)
	def from_crawler(cls, crawler):
		unique_index = cls(crawler.settings, crawler)
		crawler.signals.connect(unique_index.spider_opening, signal=signals.spider_opened)
		crawler.signals.connect(unique_index.spider_closing, signal=signals.spider_closed)
		crawler.unique_index = unique_index
		return add_downloadmw_to_crawler(unique_index,crawler)