mirror of https://github.com/scrapy/scrapy.git
Updated item_passed signal to send passed item in 'item' argument, instead of 'output' argument, keeping backwards compatibility for the 'output' argument. Closes #273
This commit is contained in:
parent
f984d438a0
commit
002abf204f
|
|
@ -83,10 +83,11 @@ item_passed
|
|||
-----------
|
||||
|
||||
.. signal:: item_passed
|
||||
.. function:: item_passed(item, spider, output)
|
||||
.. function:: item_passed(item, spider, original_item)
|
||||
|
||||
Sent after an item has passed all the :ref:`topics-item-pipeline` stages without
|
||||
being dropped.
|
||||
Sent after an item has passed all the :ref:`topics-item-pipeline` stages
|
||||
without being dropped. Same as :func:`item_scraped` if there are no
|
||||
pipelines enabled.
|
||||
|
||||
This signal supports returning deferreds from their handlers.
|
||||
|
||||
|
|
@ -96,9 +97,10 @@ item_passed
|
|||
:param spider: the spider which scraped the item
|
||||
:type spider: :class:`~scrapy.spider.BaseSpider` object
|
||||
|
||||
:param output: the output of the item pipeline. This is typically the
|
||||
:param original_item: the input of the item pipeline. This is typically the
|
||||
same :class:`~scrapy.item.Item` object received in the ``item``
|
||||
parameter, unless some pipeline stage created a new item.
|
||||
:type spider: :class:`~scrapy.spider.BaseSpider` object
|
||||
|
||||
item_dropped
|
||||
------------
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ class Scraper(object):
|
|||
log.err(output, 'Error processing %s' % item, spider=spider)
|
||||
else:
|
||||
log.msg(log.formatter.passed(output, spider), log.INFO, spider=spider)
|
||||
# TODO: remove item_passed 'output' parameter for Scrapy 0.12
|
||||
return send_catch_log_deferred(signal=signals.item_passed, \
|
||||
item=item, spider=spider, output=output)
|
||||
item=output, spider=spider, output=output, original_item=item)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue