summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-02-29 09:49:40 -0500
committerChris McDonough <chrism@plope.com>2012-02-29 09:49:40 -0500
commit5c58573961e65bda50c6d5d1c0575eb21fe30868 (patch)
treee6af04244de6b617fc26d2ce586a442cd5ea416a
parent54105d4f39cb411641ffca91cc021e69e634b928 (diff)
downloadpyramid-5c58573961e65bda50c6d5d1c0575eb21fe30868.tar.gz
pyramid-5c58573961e65bda50c6d5d1c0575eb21fe30868.tar.bz2
pyramid-5c58573961e65bda50c6d5d1c0575eb21fe30868.zip
try fixing this on windows
-rw-r--r--pyramid/config/views.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index b4216c220..51733aff0 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -39,6 +39,7 @@ from pyramid.compat import (
urlparse,
im_func,
url_quote,
+ WIN,
)
from pyramid.exceptions import (
@@ -1526,8 +1527,8 @@ class ViewsConfiguratorMixin(object):
some URL is visited; :meth:`pyramid.request.Request.static_url`
generates a URL to that asset.
- The ``name`` argument to ``add_static_view`` is usually a :term:`view
- name`. When this is the case, the
+ The ``name`` argument to ``add_static_view`` is usually a simple URL
+ prefix (e.g. ``'images'``). When this is the case, the
:meth:`pyramid.request.Request.static_url` API will generate a URL
which points to a Pyramid view, which will serve up a set of assets
that live in the package itself. For example:
@@ -1586,6 +1587,10 @@ class ViewsConfiguratorMixin(object):
if info is None:
info = StaticURLInfo()
self.registry.registerUtility(info, IStaticURLInfo)
+ if WIN: # pragma: no cover
+ # replace all backslashes with fwd ones; staticurlinfo expects
+ # forward-slash-based paths
+ spec.replace('\\', '/')
info.add(self, name, spec, **kw)