From 5cb9f344ac79a7454069e0cdd851ef2abaebefab Mon Sep 17 00:00:00 2001 From: elpolilla Date: Thu, 8 Jan 2009 15:42:33 +0000 Subject: [PATCH] Changed method process_spider_output name to process_results in crawl and feed spiders --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40686 --- scrapy/trunk/scrapy/contrib/spiders/crawl.py | 4 ++-- scrapy/trunk/scrapy/contrib/spiders/feed.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scrapy/trunk/scrapy/contrib/spiders/crawl.py b/scrapy/trunk/scrapy/contrib/spiders/crawl.py index 4056929f2..ff28a4dcf 100644 --- a/scrapy/trunk/scrapy/contrib/spiders/crawl.py +++ b/scrapy/trunk/scrapy/contrib/spiders/crawl.py @@ -67,7 +67,7 @@ class CrawlSpider(BaseSpider): return a list of ScrapedItems and/or Requests""" return [] - def process_spider_output(self, response, results): + def process_results(self, response, results): """This overridable method is called for each result (item or request) returned by the spider, and it's intended to perform any last time processing required before returning the results to the framework core, @@ -107,7 +107,7 @@ class CrawlSpider(BaseSpider): res.extend(self._requests_to_follow(response)) if callback: cb_res = callback(response, **cb_kwargs) or () - cb_res = self.process_spider_output(response, cb_res) + cb_res = self.process_results(response, cb_res) res.extend(cb_res) return res diff --git a/scrapy/trunk/scrapy/contrib/spiders/feed.py b/scrapy/trunk/scrapy/contrib/spiders/feed.py index f59167ed4..9829d3a3f 100644 --- a/scrapy/trunk/scrapy/contrib/spiders/feed.py +++ b/scrapy/trunk/scrapy/contrib/spiders/feed.py @@ -19,7 +19,7 @@ class XMLFeedSpider(BaseSpider): iterator = 'iternodes' itertag = 'item' - def process_spider_output(self, response, results): + def process_results(self, response, results): """This overridable method is called for each result (item or request) returned by the spider, and it's intended to perform any last time processing required before returning the results to the framework core, @@ -40,7 +40,7 @@ class XMLFeedSpider(BaseSpider): ret = [ret] if not isinstance(ret, (list, tuple)): raise UsageError('You cannot return an "%s" object from a spider' % type(ret).__name__) - for result_item in self.process_spider_output(response, ret): + for result_item in self.process_results(response, ret): yield result_item def parse(self, response): @@ -71,7 +71,7 @@ class CSVFeedSpider(BaseSpider): delimiter = None # When this is None, python's csv module's default delimiter is used headers = None - def process_spider_output(self, response, results): + def process_results(self, response, results): """This method has the same purpose as the one in XMLFeedSpider""" return results @@ -86,7 +86,7 @@ class CSVFeedSpider(BaseSpider): ret = [ret] if not isinstance(ret, (list, tuple)): raise UsageError('You cannot return an "%s" object from a spider' % type(ret).__name__) - for result_item in self.process_spider_output(response, ret): + for result_item in self.process_results(response, ret): yield result_item def parse(self, response):