Changeset 1848:8a8cce84d4c2
- Timestamp:
- 11/13/09 20:04:39 (10 months ago)
- Author:
- Pablo Hoffman <pablo@…>
- Parents:
- 1847:090ae224595c (diff), 1846:bbd7752e74f9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
- Branch:
- default
- Message:
-
Automated merge with http://hg.scrapy.org/scrapy-stable/
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1822
|
r1848
|
|
| 166 | 166 | |
| 167 | 167 | .. signal:: request_received |
| 168 | | .. function:: request_received(request, spider, response) |
| | 168 | .. function:: request_received(request, spider) |
| 169 | 169 | |
| 170 | 170 | Sent when the engine receives a :class:`~scrapy.http.Request` from a spider. |
| … |
… |
|
| 176 | 176 | :type spider: :class:`~scrapy.spider.BaseSpider` object |
| 177 | 177 | |
| 178 | | :param response: the :class:`~scrapy.http.Response` fed to the spider which |
| 179 | | generated the request later |
| 180 | | :type response: :class:`~scrapy.http.Response` object |
| 181 | | |
| 182 | 178 | request_uploaded |
| 183 | 179 | ---------------- |
-
|
r1847
|
r1848
|
|
| 30 | 30 | order. |
| 31 | 31 | |
| 32 | | domain_closed |
| | 32 | spider_closed |
| 33 | 33 | ------------- |
| 34 | 34 | |
| 35 | | .. signal:: domain_closed |
| 36 | | .. function:: domain_closed(domain, spider, reason) |
| 37 | | |
| 38 | | Sent after a spider/domain has been closed. This can be used to release |
| 39 | | per-spider resources reserved on :signal:`domain_opened`. |
| 40 | | |
| 41 | | :param domain: a string which contains the domain of the spider which has |
| 42 | | been closed |
| 43 | | :type domain: str |
| | 35 | .. signal:: spider_closed |
| | 36 | .. function:: spider_closed(spider, reason) |
| | 37 | |
| | 38 | Sent after a spider has been closed. This can be used to release per-spider |
| | 39 | resources reserved on :signal:`spider_opened`. |
| 44 | 40 | |
| 45 | 41 | :param spider: the spider which has been closed |
| 46 | 42 | :type spider: :class:`~scrapy.spider.BaseSpider` object |
| 47 | 43 | |
| 48 | | :param reason: a string which describes the reason why the domain was closed. If |
| 49 | | it was closed because the domain has completed scraping, it the reason |
| 50 | | is ``'finished'``. Otherwise, if the domain was manually closed by |
| 51 | | calling the ``close_domain`` engine method, then the reason is the one |
| | 44 | :param reason: a string which describes the reason why the spider was closed. If |
| | 45 | it was closed because the spider has completed scraping, it the reason |
| | 46 | is ``'finished'``. Otherwise, if the spider was manually closed by |
| | 47 | calling the ``close_spider`` engine method, then the reason is the one |
| 52 | 48 | passed in the ``reason`` argument of that method (which defaults to |
| 53 | 49 | ``'cancelled'``). If the engine was shutdown (for example, by hitting |
| … |
… |
|
| 55 | 51 | :type reason: str |
| 56 | 52 | |
| 57 | | domain_opened |
| | 53 | spider_opened |
| 58 | 54 | ------------- |
| 59 | 55 | |
| 60 | | .. signal:: domain_opened |
| 61 | | .. function:: domain_opened(domain, spider) |
| 62 | | |
| 63 | | Sent after a spider/domain has been opened for crawling. This is typically |
| 64 | | used to reserve per-spider resources, but can be used for any task that |
| 65 | | needs to be performed when a spider/domain is opened. |
| 66 | | |
| 67 | | :param domain: a string with the domain of the spider which has been opened |
| 68 | | :type domain: str |
| | 56 | .. signal:: spider_opened |
| | 57 | .. function:: spider_opened(spider) |
| | 58 | |
| | 59 | Sent after a spider has been opened for crawling. This is typically used to |
| | 60 | reserve per-spider resources, but can be used for any task that needs to be |
| | 61 | performed when a spider is opened. |
| 69 | 62 | |
| 70 | 63 | :param spider: the spider which has been opened |
| 71 | 64 | :type spider: :class:`~scrapy.spider.BaseSpider` object |
| 72 | 65 | |
| 73 | | domain_idle |
| | 66 | spider_idle |
| 74 | 67 | ----------- |
| 75 | 68 | |
| 76 | | .. signal:: domain_idle |
| 77 | | .. function:: domain_idle(domain, spider) |
| 78 | | |
| 79 | | Sent when a domain has gone idle, which means the spider has no further: |
| | 69 | .. signal:: spider_idle |
| | 70 | .. function:: spider_idle(spider) |
| | 71 | |
| | 72 | Sent when a spider has gone idle, which means the spider has no further: |
| 80 | 73 | |
| 81 | 74 | * requests waiting to be downloaded |
| … |
… |
|
| 84 | 77 | |
| 85 | 78 | If the idle state persists after all handlers of this signal have finished, |
| 86 | | the engine starts closing the domain. After the domain has finished |
| 87 | | closing, the :signal:`domain_closed` signal is sent. |
| 88 | | |
| 89 | | You can, for example, schedule some requests in your :signal:`domain_idle` |
| 90 | | handler to prevent the domain from being closed. |
| 91 | | |
| 92 | | :param domain: is a string with the domain of the spider which has gone idle |
| 93 | | :type domain: str |
| | 79 | the engine starts closing the spider. After the spider has finished |
| | 80 | closing, the :signal:`spider_closed` signal is sent. |
| | 81 | |
| | 82 | You can, for example, schedule some requests in your :signal:`spider_idle` |
| | 83 | handler to prevent the spider from being closed. |
| 94 | 84 | |
| 95 | 85 | :param spider: the spider which has gone idle |