Alow to disable a downloader handler just like any other component.

This commit is contained in:
Rolando Espinoza La fuente 2013-11-06 21:21:35 -04:00 committed by Julia Medina
parent f921d2aff1
commit a1df15b9ce
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,10 @@ class DownloadHandlers(object):
handlers = crawler.settings.get('DOWNLOAD_HANDLERS_BASE')
handlers.update(crawler.settings.get('DOWNLOAD_HANDLERS', {}))
for scheme, clspath in handlers.iteritems():
# Allow to disable a handler just like any other
# component (extension, middlware, etc).
if clspath is None:
continue
cls = load_object(clspath)
try:
dh = cls(crawler.settings)