httpcache: allow to import submodules within packages as HTTPCACHE_DBM_MODULE setting.

This commit is contained in:
Rolando Espinoza La fuente 2012-11-21 10:44:35 -04:00
parent e5edb8ec3e
commit a2602df90b
1 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,8 @@ class DbmCacheStorage(object):
def __init__(self, settings):
self.cachedir = data_path(settings['HTTPCACHE_DIR'], createdir=True)
self.expiration_secs = settings.getint('HTTPCACHE_EXPIRATION_SECS')
self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE'])
self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE'],
{}, {}, [''])
self.db = None
def open_spider(self, spider):