core: allow returning None from spiders to support pipeline/download throttling

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40990
This commit is contained in:
Daniel Grana 2009-03-17 21:30:33 +00:00
parent c54a3fe7f6
commit fb3a2dab2f
1 changed files with 3 additions and 1 deletions

View File

@ -250,8 +250,10 @@ class ExecutionEngine(object):
elif isinstance(item, Request):
signals.send_catch_log(signal=signals.request_received, sender=self.__class__, request=item, spider=spider, response=response)
self.crawl(request=item, spider=spider, priority=priority)
elif item is None:
pass # may be next time.
else:
log.msg("Spider must return Request or ScrapedItem objects, got '%s' while processing %s" % (type(item).__name__, request), log.WARNING, domain=domain)
log.msg("Spider can return Request, ScrapedItem or None, got '%s' while processing %s" % (type(item).__name__, request), log.WARNING, domain=domain)
class _ResultContainer(object):
def append(self, item):