diff options
author | ianb <devnull@localhost> | 2008-04-27 06:26:53 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2008-04-27 06:26:53 +0000 |
commit | ad6924deae625ce803937bf8511b4985464f55ee (patch) | |
tree | 98e7ca0c58dc5e181d6b918a68a7d0a7d2da9b2f | |
parent | 6899dbab4003886a5ed0eff27667ed2ffd7663e7 (diff) | |
download | paste-ad6924deae625ce803937bf8511b4985464f55ee.tar.gz |
small docstring formatting fixes
-rw-r--r-- | paste/cascade.py | 23 | ||||
-rw-r--r-- | paste/cgiapp.py | 2 | ||||
-rw-r--r-- | paste/errordocument.py | 2 | ||||
-rw-r--r-- | paste/recursive.py | 8 | ||||
-rw-r--r-- | paste/registry.py | 6 | ||||
-rw-r--r-- | paste/response.py | 2 | ||||
-rw-r--r-- | paste/wsgilib.py | 6 | ||||
-rw-r--r-- | paste/wsgiwrappers.py | 2 |
8 files changed, 30 insertions, 21 deletions
diff --git a/paste/cascade.py b/paste/cascade.py index fb4ea7b..1c4acfb 100644 --- a/paste/cascade.py +++ b/paste/cascade.py @@ -14,15 +14,17 @@ __all__ = ['Cascade'] def make_cascade(loader, global_conf, catch='404', **local_conf): """ - Expects configuration like: + Entry point for Paste Deploy configuration + + Expects configuration like:: - [composit:cascade] - use = egg:Paste#cascade - # all start with 'app' and are sorted alphabetically - app1 = foo - app2 = bar - ... - catch = 404 500 ... + [composit:cascade] + use = egg:Paste#cascade + # all start with 'app' and are sorted alphabetically + app1 = foo + app2 = bar + ... + catch = 404 500 ... """ catch = map(int, converters.aslist(catch)) apps = [] @@ -48,6 +50,8 @@ class Cascade(object): If all applications fail, then the last application's failure response is used. + + Instances of this class are WSGI applications. """ def __init__(self, applications, catch=(404,)): @@ -68,6 +72,9 @@ class Cascade(object): self.catch_exceptions = tuple(self.catch_exceptions) def __call__(self, environ, start_response): + """ + WSGI application interface + """ failed = [] def repl_start_response(status, headers, exc_info=None): code = int(status.split(None, 1)[0]) diff --git a/paste/cgiapp.py b/paste/cgiapp.py index c21ee95..e1ede03 100644 --- a/paste/cgiapp.py +++ b/paste/cgiapp.py @@ -256,6 +256,8 @@ def proc_communicate(proc, stdin=None, stdout=None, stderr=None): def make_cgi_application(global_conf, script, path=None, include_os_environ=None, query_string=None): """ + Paste Deploy interface for :class:`CGIApplication` + This object acts as a proxy to a CGI application. You pass in the script path (``script``), an optional path to search for the script (if the name isn't absolute) (``path``). If you don't give diff --git a/paste/errordocument.py b/paste/errordocument.py index 90bda8a..babdd8f 100644 --- a/paste/errordocument.py +++ b/paste/errordocument.py @@ -117,7 +117,7 @@ class StatusBasedForward(object): could be useful for passing the status code and message into another application to display an error document: - .. code-block:: Python + .. code-block:: python from paste.errordocument import StatusBasedForward from paste.recursive import RecursiveMiddleware diff --git a/paste/recursive.py b/paste/recursive.py index 6f54fd1..8df060b 100644 --- a/paste/recursive.py +++ b/paste/recursive.py @@ -104,7 +104,7 @@ class ForwardRequestException(Exception): Basic usage (must have ``RecursiveMiddleware`` present) : - .. code-block:: Python + .. code-block:: python from paste.recursive import ForwardRequestException def app(environ, start_response): @@ -130,7 +130,7 @@ class ForwardRequestException(Exception): You could also specify an ``environ`` dictionary instead of a url. Using the same example as before: - .. code-block:: Python + .. code-block:: python def app(environ, start_response): ... same as previous example ... @@ -144,7 +144,7 @@ class ForwardRequestException(Exception): but use the headers and resposne body from the forwarded response you might do this: - .. code-block:: Python + .. code-block:: python from paste.recursive import ForwardRequestException from paste.recursive import RecursiveMiddleware @@ -286,7 +286,7 @@ class Forwarder(Recursive): It returns an iterator that must be returned back up the call stack, so it must be used like: - .. code-block:: Python + .. code-block:: python return environ['paste.recursive.forward'](path) diff --git a/paste/registry.py b/paste/registry.py index 9100074..fba1822 100644 --- a/paste/registry.py +++ b/paste/registry.py @@ -23,7 +23,7 @@ WSGI application everything will work properly. Example: -.. code-block:: Python +.. code-block:: python #yourpackage/__init__.py @@ -63,7 +63,7 @@ thousands of times per request, the performance of the proxy will start to become more noticeable. In that circumstance, the problem can be avoided by getting at the actual object via the proxy with the ``_current_obj`` function: -.. code-block:: Python +.. code-block:: python #sessions.py Session = StackedObjectProxy() @@ -198,7 +198,7 @@ class StackedObjectProxy(object): This should be used like: - .. code-block:: Python + .. code-block:: python obj = yourobject() module.glob = StackedObjectProxy() diff --git a/paste/response.py b/paste/response.py index c35639c..f0009c8 100644 --- a/paste/response.py +++ b/paste/response.py @@ -197,7 +197,7 @@ def error_response(environ, error_code, message, Use like: - .. code-block:: Python + .. code-block:: python status, headers, body = wsgilib.error_response( '301 Moved Permanently', 'Moved to <a href="%s">%s</a>' diff --git a/paste/wsgilib.py b/paste/wsgilib.py index d033387..67ced97 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -437,7 +437,7 @@ def capture_output(environ, start_response, application): Sends status and header, but *not* body. Returns (status, headers, body). Typically this is used like: - .. code-block:: Python + .. code-block:: python def dehtmlifying_middleware(application): def replacement_app(environ, start_response): @@ -488,7 +488,7 @@ def intercept_output(environ, application, conditional=None, Typically this is used like: - .. code-block:: Python + .. code-block:: python def dehtmlifying_middleware(application): def replacement_app(environ, start_response): @@ -510,7 +510,7 @@ def intercept_output(environ, application, conditional=None, will be returned. You must detect that in your code and return the app_iter, like: - .. code-block:: Python + .. code-block:: python def dehtmlifying_middleware(application): def replacement_app(environ, start_response): diff --git a/paste/wsgiwrappers.py b/paste/wsgiwrappers.py index 1ed2bf2..8368502 100644 --- a/paste/wsgiwrappers.py +++ b/paste/wsgiwrappers.py @@ -337,7 +337,7 @@ class WSGIResponse(object): Example usage: - .. code-block:: Python + .. code-block:: python def wsgi_app(environ, start_response): response = WSGIResponse() |