summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-07-02 01:47:47 +0000
committerChris McDonough <chrism@agendaless.com>2010-07-02 01:47:47 +0000
commitb29429e470c093573f3735b0dbf09d42c29cfe4d (patch)
tree8dfa266de6bd0f10a80d9654fe3ddf3a7897c467 /repoze/bfg/interfaces.py
parent78a659d76e5bbb7544212174f010c1f50f8bcbe6 (diff)
downloadpyramid-b29429e470c093573f3735b0dbf09d42c29cfe4d.tar.gz
pyramid-b29429e470c093573f3735b0dbf09d42c29cfe4d.tar.bz2
pyramid-b29429e470c093573f3735b0dbf09d42c29cfe4d.zip
- The ``repoze.bfg.url.route_url`` API has changed. If a keyword
``_app_url`` is present in the arguments passed to ``route_url``, this value will be used as the protocol/hostname/port/leading path prefix of the generated URL. For example, using an ``_app_url`` of ``http://example.com:8080/foo`` would cause the URL ``http://example.com:8080/foo/fleeb/flub`` to be returned from this function if the expansion of the route pattern associated with the ``route_name`` expanded to ``/fleeb/flub``. - It is now possible to use a URL as the ``name`` argument fed to ``repoze.bfg.configuration.Configurator.add_static_view``. When the name argument is a URL, the ``repoze.bfg.url.static_url`` API will generate join this URL (as a prefix) to a path including the static file name. This makes it more possible to put static media on a separate webserver for production, while keeping static media package-internal and served by the development webserver during development.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index 09b639525..814e558f6 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -29,8 +29,7 @@ class IWSGIApplicationCreatedEvent(Interface):
class IRequest(Interface):
""" Request type interface attached to all request objects """
-# for exception view lookups
-IRequest.combined = IRequest
+IRequest.combined = IRequest # for exception view lookups
class IRouteRequest(Interface):
""" *internal only* interface used as in a utility lookup to find
@@ -72,6 +71,13 @@ class IAuthorizationPolicy(Interface):
def principals_allowed_by_permission(context, permission):
""" Return a set of principal identifiers allowed by the permission """
+class IStaticURLInfo(Interface):
+ """ A policy for generating URLs to static resources """
+ def add(name, spec, **extra):
+ """ Add a new static info registration """
+
+ def generate(path, request, **kw):
+ """ Generate a URL for the given path """
class IResponseFactory(Interface):
""" A utility which generates a response factory """