aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-07-23 15:29:22 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-08-01 23:50:39 +0200
commit937e2c88112ee2f2ec71b9b38ccb1b473f32237e (patch)
tree0a5c05716cf8a29d246934ac3cd95c4df881da5d
parent93b2796c7e89e269d60db8e48bf84a0f2ca88d12 (diff)
downloadmediagoblin-937e2c88112ee2f2ec71b9b38ccb1b473f32237e.tar.lz
mediagoblin-937e2c88112ee2f2ec71b9b38ccb1b473f32237e.tar.xz
mediagoblin-937e2c88112ee2f2ec71b9b38ccb1b473f32237e.zip
MountStorage: Create all the wrappers
All those methods just call the appropiate method of the relevant backend.
-rw-r--r--mediagoblin/storage.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/mediagoblin/storage.py b/mediagoblin/storage.py
index d994268b..e3d54a30 100644
--- a/mediagoblin/storage.py
+++ b/mediagoblin/storage.py
@@ -292,6 +292,34 @@ class MountStorage(StorageInterface):
else:
return res
+ def file_exists(self, filepath):
+ backend, filepath = self.resolve_to_backend(filepath)
+ return backend.file_exists(filepath)
+
+ def get_file(self, filepath, mode='r'):
+ backend, filepath = self.resolve_to_backend(filepath)
+ return backend.get_file(filepath, mode)
+
+ def delete_file(self, filepath):
+ backend, filepath = self.resolve_to_backend(filepath)
+ return backend.delete_file(filepath)
+
+ def file_url(self, filepath):
+ backend, filepath = self.resolve_to_backend(filepath)
+ return backend.file_url(filepath)
+
+ def get_local_path(self, filepath):
+ backend, filepath = self.resolve_to_backend(filepath)
+ return backend.get_local_path(filepath)
+
+ def copy_locally(self, filepath, dest_path):
+ """
+ Need to override copy_locally, because the local_storage
+ attribute is not correct.
+ """
+ backend, filepath = self.resolve_to_backend(filepath)
+ backend.copy_locally(filepath, dest_path)
+
###########
# Utilities