summaryrefslogtreecommitdiff
path: root/paste/config.py
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2007-03-06 04:04:33 +0000
committerpjenvey <devnull@localhost>2007-03-06 04:04:33 +0000
commit89aad6a095c8d5234daa9517fe2cf63dbef7ee35 (patch)
treeb184649d2d710bb99f41ae8d45b7db6d4cb90e75 /paste/config.py
parentcd7820a4405f3f8826b8203f89d95a4807cc60ee (diff)
downloadpaste-89aad6a095c8d5234daa9517fe2cf63dbef7ee35.tar.gz
allow ConfigMiddleware to use a different DispatchingConfig
Diffstat (limited to 'paste/config.py')
-rw-r--r--paste/config.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/paste/config.py b/paste/config.py
index a33c919..f6ef16f 100644
--- a/paste/config.py
+++ b/paste/config.py
@@ -85,10 +85,11 @@ class ConfigMiddleware(RegistryManager):
"""
A WSGI middleware that adds a ``paste.config`` key to the request
environment, as well as registering the configuration temporarily
- (for the length of the request) with ``paste.config.CONFIG``.
+ (for the length of the request) with ``paste.config.CONFIG`` (or
+ any other ``DispatchingConfig`` object).
"""
- def __init__(self, application, config):
+ def __init__(self, application, config, dispatching_config=CONFIG):
"""
This delegates all requests to `application`, adding a *copy*
of the configuration `config`.
@@ -99,7 +100,7 @@ class ConfigMiddleware(RegistryManager):
popped_config = environ['paste.config']
conf = environ['paste.config'] = config.copy()
- environ['paste.registry'].register(CONFIG, conf)
+ environ['paste.registry'].register(dispatching_config, conf)
try:
app_iter = application(environ, start_response)