Scrapy, a fast high-level web crawling & scraping framework for Python.
remove response from item_passed and item_dropped signal api
Daniel Granaeff8ea61730e
diff --git a/docs/ref/signals.rst b/docs/ref/signals.rstindex 97d8a71bc..5e1435d6c 100644--- a/docs/ref/signals.rst+++ b/docs/ref/signals.rst@@ -115,7 +115,7 @@ order.:type response: :class:`~scrapy.http.Response` object.. signal:: item_passed-.. function:: item_passed(item, spider, response, output)+.. function:: item_passed(item, spider, output)Sent after an item has passed all the :ref:`topics-item-pipeline` stages withoutbeing dropped.@@ -126,15 +126,12 @@ order.:param spider: the spider which scraped the item:type spider: :class:`~scrapy.spider.BaseSpider` object- :param response: the response from which the item was scraped- :type response: :class:`~scrapy.http.Response` object-:param output: the output of the item pipeline. This is typically thesame :class:`~scrapy.item.ScrapedItem` object received in the ``item``parameter, unless some pipeline stage created a new item... signal:: item_dropped-.. function:: item_dropped(item, spider, response, exception)+.. function:: item_dropped(item, spider, exception)Sent after an item has been dropped from the :ref:`topics-item-pipeline`when some stage raised a :exception:`DropItem` exception.@@ -145,9 +142,6 @@ order.:param spider: the spider which scraped the item:type spider: :class:`~scrapy.spider.BaseSpider` object- :param response: the response from which the item was scraped- :type response: :class:`~scrapy.http.Response` object-:param exception: the exception (which must be a :exception:`DropItem`subclass) which caused the item to be dropped:type exception: :exception:`DropItem` exceptiondiff --git a/scrapy/core/scraper.py b/scrapy/core/scraper.pyindex f6a65c439..5bdaa115a 100644--- a/scrapy/core/scraper.py+++ b/scrapy/core/scraper.py@@ -157,7 +157,7 @@ class Scraper(object):item=output, spider=spider, response=response)self.sites[domain].itemproc_size += 1dfd = self.itemproc.process_item(output, spider)- dfd.addBoth(self._itemproc_finished, output, response, spider)+ dfd.addBoth(self._itemproc_finished, output, spider)return dfdelif output is None:pass@@ -179,7 +179,7 @@ class Scraper(object):else:return spider_failure # exceptions raised in the spider code- def _itemproc_finished(self, output, item, response, spider):+ def _itemproc_finished(self, output, item, spider):"""ItemProcessor finished for the given ``item`` and returned ``output``"""domain = spider.domain_name@@ -189,11 +189,11 @@ class Scraper(object):if isinstance(ex, DropItem):log.msg("Dropped %s - %s" % (item, str(ex)), log.DEBUG, domain=domain)signals.send_catch_log(signal=signals.item_dropped, sender=self.__class__, \- item=item, spider=spider, response=response, exception=output.value)+ item=item, spider=spider, exception=output.value)else:log.msg('Error processing %s - %s' % (item, output), \log.ERROR, domain=domain)else:signals.send_catch_log(signal=signals.item_passed, sender=self.__class__, \- item=item, spider=spider, response=response, output=output)+ item=item, spider=spider, output=output)