summaryrefslogtreecommitdiff
path: root/paste/recursive.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2006-09-02 23:40:11 +0000
committerbbangert <devnull@localhost>2006-09-02 23:40:11 +0000
commit7e3e549af3852c87697885df4b60daa8b63b370f (patch)
tree720145c564522be8df81c74e4943ce685b94dd7c /paste/recursive.py
parente944374d649a29449b4a3266a485eb5ca31ecf78 (diff)
downloadpaste-7e3e549af3852c87697885df4b60daa8b63b370f.tar.gz
Adding code-block directive to Python code samples.
Diffstat (limited to 'paste/recursive.py')
-rw-r--r--paste/recursive.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/paste/recursive.py b/paste/recursive.py
index 50ab942..37e41ae 100644
--- a/paste/recursive.py
+++ b/paste/recursive.py
@@ -101,7 +101,9 @@ class ForwardRequestException(Exception):
as the first argument and returns an initialised WSGI middleware
which can alter the forwarded response.
- Basic usage (must have ``RecursiveMiddleware`` present) ::
+ Basic usage (must have ``RecursiveMiddleware`` present) :
+
+ .. code-block:: Python
from paste.recursive import ForwardRequestException
def app(environ, start_response):
@@ -125,7 +127,9 @@ class ForwardRequestException(Exception):
a ``404 Not found`` status message.
You could also specify an ``environ`` dictionary instead of a url. Using
- the same example as before::
+ the same example as before:
+
+ .. code-block:: Python
def app(environ, start_response):
... same as previous example ...
@@ -137,7 +141,9 @@ class ForwardRequestException(Exception):
Finally, if you want complete control over every aspect of the forward you
can specify a middleware factory. For example to keep the old status code
but use the headers and resposne body from the forwarded response you might
- do this::
+ do this:
+
+ .. code-block:: Python
from paste.recursive import ForwardRequestException
from paste.recursive import RecursiveMiddleware
@@ -266,7 +272,9 @@ class Forwarder(Recursive):
It must not be called after and headers have been returned.
It returns an iterator that must be returned back up the call
- stack, so it must be used like::
+ stack, so it must be used like:
+
+ .. code-block:: Python
return environ['paste.recursive.forward'](path)