[cc-commits] [SCM] License chooser & etc (branch master) updated. 559a5bf61423ec55ed3ef6747652a68658581293
git version control
git at a7.creativecommons.org
Tue Jan 5 01:13:18 EST 2010
The branch, master has been updated
via 559a5bf61423ec55ed3ef6747652a68658581293 (commit)
via 25f3c86281cc16fdef6630307dab00a7151e8be1 (commit)
from 2c191bb686bdadad0f409b79b9cb5c7f36f6846e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 559a5bf61423ec55ed3ef6747652a68658581293
Author: Christopher Allan Webber <cwebber at dustycloud.org>
Date: Tue Jan 5 00:11:06 2010 -0600
Example direct_remote_path(s) entries
commit 25f3c86281cc16fdef6630307dab00a7151e8be1
Author: Christopher Allan Webber <cwebber at dustycloud.org>
Date: Tue Jan 5 00:10:28 2010 -0600
Making slashes in static resource url direction work better
-----------------------------------------------------------------------
Summary of changes (followed by patch):
cc.engine.ini | 4 ++++
cc/engine/static.py | 12 ++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/cc.engine.ini b/cc.engine.ini
index 5a0c57b..34d6a2a 100644
--- a/cc.engine.ini
+++ b/cc.engine.ini
@@ -6,6 +6,10 @@ use = egg:cc.engine#app
reload_templates = true
debug_authorization = false
debug_notfound = false
+#direct_remote_path = /foo/bar/
+#direct_remote_paths =
+# foo http://foo/bar/baz
+# blah /ping/bot
[server:main]
use = egg:Paste#http
diff --git a/cc/engine/static.py b/cc/engine/static.py
index ea921cb..34dd61f 100644
--- a/cc/engine/static.py
+++ b/cc/engine/static.py
@@ -24,25 +24,29 @@ class LocalStaticDirect(StaticDirect):
except for development!
"""
def get(self, request, filepath):
- return request.urlgen('staticserve', filename=filepath)
+ return request.urlgen('staticserve', filename=filepath.lstrip('/'))
class RemoteStaticDirect(StaticDirect):
def __init__(self, remotepath):
+ StaticDirect.__init__(self)
self.remotepath = remotepath
def get(self, request, filepath):
- return urlparse.urljoin(self.remotepath, filepath)
+ return '%s/%s' % (
+ self.remotepath, rest.lstrip('/'))
class MultiRemoteStaticDirect(StaticDirect):
"""
"""
def __init__(self, remotepaths):
+ StaticDirect.__init__(self)
self.remotepaths = remotepaths
def get(self, request, filepath):
section, rest = filepath.strip('/').split('/', 1)
- return urlparse.urljoin(
- self.remotepaths[section], rest)
+ return '%s/%s' % (
+ self.remotepaths[section].rstrip('/'),
+ rest.lstrip('/'))
hooks/post-receive
--
License chooser & etc
More information about the cc-commits
mailing list