From: Joar Wandborg Date: Thu, 1 Sep 2011 22:50:13 +0000 (-0500) Subject: Bug #532 - CloudFiles StorageObjectWrapper AttributeError - Fix + More X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bf821aef560c7aff83c4d2a16324e20f608c6dfa;p=mediagoblin.git Bug #532 - CloudFiles StorageObjectWrapper AttributeError - Fix + More Additionally: Extended get_file to accept both *args and **kwargs and to pass that further down the line to StorageObjectWrapper. Might be useful in the future. --- diff --git a/mediagoblin/storage.py b/mediagoblin/storage.py index 39c9eafc..6a44850c 100644 --- a/mediagoblin/storage.py +++ b/mediagoblin/storage.py @@ -274,7 +274,7 @@ class CloudFilesStorage(StorageInterface): except cloudfiles.errors.NoSuchObject: return False - def get_file(self, filepath, *args): + def get_file(self, filepath, *args, **kwargs): """ - Doesn't care about the "mode" argument """ @@ -291,7 +291,7 @@ class CloudFilesStorage(StorageInterface): if mimetype: obj.content_type = mimetype[0] - return self.StorageObjectWrapper(obj) + return StorageObjectWrapper(obj, *args, **kwargs) def delete_file(self, filepath): # TODO: Also delete unused directories if empty (safely, with @@ -315,7 +315,7 @@ class StorageObjectWrapper(): This wrapper currently meets mediagoblin's needs for a public_store file-like object. """ - def __init__(self, storage_object): + def __init__(self, storage_object, *args, **kwargs): self.storage_object = storage_object def read(self, *args, **kwargs):