Added the url_for_file stub to the interface
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 10 Apr 2011 20:01:00 +0000 (15:01 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 10 Apr 2011 20:01:00 +0000 (15:01 -0500)
mediagoblin/storage.py

index a1a3b3a438bb4a94f7807613292570c2c4eb845c..87435ff2d21430addd9fca897e2189463562393b 100644 (file)
@@ -104,6 +104,14 @@ class StorageInterface(object):
         # Subclasses should override this method.
         self.__raise_not_implemented()
 
+    def url_for_file(self, filepath):
+        """
+        Get the URL for this file.  This assumes our storage has been
+        mounted with some kind of URL which makes this possible.
+        """
+        # Subclasses should override this method.
+        self.__raise_not_implemented()
+
     def get_unique_filename(self, filepath):
         """
         If a filename at filepath already exists, generate a new name.
@@ -152,3 +160,6 @@ class BasicFileStorage(StorageInterface):
 
     def delete_file(self, filepath):
         pass
+
+    def url_for_file(self, filepath):
+        pass