From 5c58573961e65bda50c6d5d1c0575eb21fe30868 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 29 Feb 2012 09:49:40 -0500 Subject: try fixing this on windows --- pyramid/config/views.py | 9 +++++++-- 1 file 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) -- cgit v1.2.3