From 89aad6a095c8d5234daa9517fe2cf63dbef7ee35 Mon Sep 17 00:00:00 2001 From: pjenvey Date: Tue, 6 Mar 2007 04:04:33 +0000 Subject: allow ConfigMiddleware to use a different DispatchingConfig --- paste/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'paste/config.py') 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) -- cgit v1.2.1