diff options
Diffstat (limited to 'mediagoblin/storage/__init__.py')
-rw-r--r-- | mediagoblin/storage/__init__.py | 12 |
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 |