diff options
author | ianb <devnull@localhost> | 2006-10-20 18:44:11 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-10-20 18:44:11 +0000 |
commit | 418344755d66d2d7347cf5d7792d23991d68f7c5 (patch) | |
tree | d781f021d21840e1607d5470a4019c0db1e9110c /paste/recursive.py | |
parent | b46c17a62ff0536926f79c188fc3c23d3955d467 (diff) | |
download | paste-418344755d66d2d7347cf5d7792d23991d68f7c5.tar.gz |
moved entry point for recursive
Diffstat (limited to 'paste/recursive.py')
-rw-r--r-- | paste/recursive.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/paste/recursive.py b/paste/recursive.py index 37e41ae..a56c174 100644 --- a/paste/recursive.py +++ b/paste/recursive.py @@ -6,17 +6,18 @@ Middleware to make internal requests and forward requests internally. When applied, several keys are added to the environment that will allow you to trigger recursive redirects and forwards. -``paste.recursive.include``: - When you call ``environ['paste.recursive.include'](new_path_info)`` - a response will be returned. The response has a ``body`` attribute, - a ``status`` attribute, and a ``headers`` attribute. + paste.recursive.include: + When you call + ``environ['paste.recursive.include'](new_path_info)`` a response + will be returned. The response has a ``body`` attribute, a + ``status`` attribute, and a ``headers`` attribute. -``paste.recursive.script_name``: - The ``SCRIPT_NAME`` at the point that recursive lives. Only paths - underneath this path can be redirected to. + paste.recursive.script_name: + The ``SCRIPT_NAME`` at the point that recursive lives. Only + paths underneath this path can be redirected to. -``paste.recursive.old_path_info``: - A list of previous ``PATH_INFO`` values from previous redirects. + paste.recursive.old_path_info: + A list of previous ``PATH_INFO`` values from previous redirects. Raise ``ForwardRequestException(new_path_info)`` to do a forward (aborting the current request). @@ -60,7 +61,6 @@ class RecursiveMiddleware(object): def __init__(self, application, global_conf=None): self.application = application - def __call__(self, environ, start_response): environ['paste.recursive.forward'] = Forwarder( self.application, @@ -382,3 +382,8 @@ class IncludedAppIterResponse(object): def write(self, s): self.accumulated.append + +def make_recursive_middleware(app, global_conf): + return RecursiveMiddleware(app) + +make_recursive_middleware.__doc__ = __doc__ |