1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-26 01:23:56 +00:00

allow overriding store_uri by extending ImagePipeline

--HG--
extra : rebase_source : 5c561b8282f733ab0f26607059dd96d858154426
This commit is contained in:
Daniel Grana 2011-07-15 15:17:38 -03:00
parent 84f518fc5e
commit bdd627fe1d

View File

@ -154,6 +154,8 @@ class ImagesPipeline(MediaPipeline):
}
def __init__(self, store_uri, download_func=None):
if not store_uri:
raise NotConfigured
self.store = self._get_store(store_uri)
super(ImagesPipeline, self).__init__(download_func=download_func)
@ -167,8 +169,6 @@ class ImagesPipeline(MediaPipeline):
s3store.AWS_ACCESS_KEY_ID = settings['AWS_ACCESS_KEY_ID']
s3store.AWS_SECRET_ACCESS_KEY = settings['AWS_SECRET_ACCESS_KEY']
store_uri = settings['IMAGES_STORE']
if not store_uri:
raise NotConfigured
return cls(store_uri)
def _get_store(self, uri):