Kill MultiRemoteStaticDirect... nobody was really using it anyway

Since we're adding the new "domain" staticdirect system we should
clean this up.
This commit is contained in:
Christopher Allan Webber 2012-07-06 11:25:42 -05:00
parent e8d4e58214
commit 00eda826cb
2 changed files with 4 additions and 27 deletions

View 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

View 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('/'))