More documentation on all the core storage API methods
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Apr 2011 19:26:41 +0000 (14:26 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Apr 2011 19:26:41 +0000 (14:26 -0500)
mediagoblin/storage.py

index 8e62a3a6ad34bfe6030fc7a2c90b3cc73e848391..4e0960c7d7ca42eb766359978751437690ada831 100644 (file)
@@ -84,11 +84,22 @@ class StorageInterface(object):
         # Subclasses should override this method.
         self.__raise_not_implemented()
 
-    def get_file(self, filepath):
+    def get_file(self, filepath, mode):
+        """
+        Return a file-like object for reading/writing from this filepath.
+
+        Should create directories, buckets, whatever, as necessary.
+        """
         # Subclasses should override this method.
         self.__raise_not_implemented()
 
     def delete_file(self, filepath):
+        """
+        Delete or dereference the file at filepath.
+
+        This might need to delete directories, buckets, whatever, for
+        cleanliness.  (Be sure to avoid race conditions on that though)
+        """
         # Subclasses should override this method.
         self.__raise_not_implemented()