aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/storage/__init__.py
diff options
context:
space:
mode:
authorAaron Williamson <aaron@copiesofcopies.org>2012-01-17 00:59:21 -0500
committerAaron Williamson <aaron@copiesofcopies.org>2012-01-17 00:59:21 -0500
commit99a270e95298b248a77b07203ab3921078bd7906 (patch)
tree34711abf27ab7a614c92842b456bf74ec3d5d5fb /mediagoblin/storage/__init__.py
parent25b48323a86a1036112f2f33c889d5d12d5dee9c (diff)
parent8c7701f9f1653cf4038143cfb7a497ae21edf108 (diff)
downloadmediagoblin-99a270e95298b248a77b07203ab3921078bd7906.tar.lz
mediagoblin-99a270e95298b248a77b07203ab3921078bd7906.tar.xz
mediagoblin-99a270e95298b248a77b07203ab3921078bd7906.zip
Merged changes with upstream
Diffstat (limited to 'mediagoblin/storage/__init__.py')
-rw-r--r--mediagoblin/storage/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mediagoblin/storage/__init__.py b/mediagoblin/storage/__init__.py
index 9e592b9e..0840614b 100644
--- a/mediagoblin/storage/__init__.py
+++ b/mediagoblin/storage/__init__.py
@@ -169,6 +169,18 @@ class StorageInterface(object):
with file(dest_path, 'wb') as dest_file:
dest_file.write(source_file.read())
+ def copy_local_to_storage(self, filename, filepath):
+ """
+ Copy this file from locally to the storage system.
+
+ This is kind of the opposite of copy_locally. It's likely you
+ could override this method with something more appropriate to
+ your storage system.
+ """
+ with self.get_file(filepath, 'wb') as dest_file:
+ with file(filename, 'rb') as source_file:
+ dest_file.write(source_file.read())
+
###########
# Utilities