Kill MultiRemoteStaticDirect... nobody was really using it anyway
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 6 Jul 2012 16:25:42 +0000 (11:25 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 14 Jul 2012 17:55:13 +0000 (12:55 -0500)
Since we're adding the new "domain" staticdirect system we should
clean this up.

mediagoblin/init/__init__.py
mediagoblin/tools/staticdirect.py

index ae54cacfa4de1a8dcb3d99f363f0d6f5456fc75c..b86810166916db2bb3e269f569c269cdaf69f4bc 100644 (file)
@@ -102,20 +102,14 @@ def get_jinja_loader(user_template_path=None, current_theme=None):
 
 
 def get_staticdirector(app_config):
-    if 'direct_remote_path' in app_config:
-        return staticdirect.RemoteStaticDirect(
-            app_config['direct_remote_path'].strip())
-    elif 'direct_remote_paths' in app_config:
-        direct_remote_path_lines = app_config[
-            'direct_remote_paths'].strip().splitlines()
-        return staticdirect.MultiRemoteStaticDirect(
-            dict([line.strip().split(' ', 1)
-                  for line in direct_remote_path_lines]))
-    else:
+    if not 'direct_remote_path' in app_config:
         raise ImproperlyConfigured(
             "One of direct_remote_path or "
             "direct_remote_paths must be provided")
 
+    return staticdirect.RemoteStaticDirect(
+        app_config['direct_remote_path'].strip())
+
 
 def setup_storage():
     global_config = mg_globals.global_config
index 7477de68b8d62cbf9d43c8e5af6c736b5307316c..4143b453ea6d9acd6f9065bf0b29849d75524497 100644 (file)
@@ -56,20 +56,3 @@ class RemoteStaticDirect(StaticDirect):
     def get(self, filepath):
         return '%s/%s' % (
             self.remotepath, filepath.lstrip('/'))
-
-
-class MultiRemoteStaticDirect(StaticDirect):
-    """
-    For whene separate sections of the static data is served under
-    separate urls.
-    """
-    def __init__(self, remotepaths):
-        StaticDirect.__init__(self)
-        self.remotepaths = remotepaths
-
-    def get(self, filepath):
-        section, rest = filepath.strip('/').split('/', 1)
-
-        return '%s/%s' % (
-            self.remotepaths[section].rstrip('/'),
-            rest.lstrip('/'))