translate.misc.selector

Package translate :: Package misc :: Module selector |
[hide private]
[frames] | no frames]

# Module selector

source code

selector - WSGI delegation based on URL path and method.

(See the docstring of selector.Selector.)

Copyright (C) 2006 Luke Arno - http://lukearno.com/

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Luke Arno can be found at http://lukearno.com/

Classes | [hide private]
| MappingFileError
| PathExpressionParserError
| Selector WSGI middleware for URL paths and HTTP method based delegation.
| SimpleParser Callable to turn path expressions into regexes with named groups.
| EnvironDispatcher Dispatch based on list of rules.
| MiddlewareComposer Compose middleware based on list of rules.
| Naked Naked object style dispatch base class.
| ByMethod Base class for dispatching to method named by REQUEST_METHOD.

Functions | [hide private]
method_not_allowed(environ, start_response) Respond with a 405 and appropriate Allow header. | source code
not_found(environ, start_response) Respond with a 404. | source code
expose(obj) Set obj._exposed = True and return obj. | source code
pliant(func) Decorate an unbound wsgi callable taking args from wsgiorg.routing_args. | source code
opliant(meth) Decorate a bound wsgi callable taking args from wsgiorg.routing_args. | source code

Variables | [hide private]
| __package__ = ``'``translate.misc``'``

Imports: re, starmap, shift_path_info, resolve

Function Details | [hide private]

### pliant(func) | source code
    Decorate an unbound wsgi callable taking args from wsgiorg.routing_args.

    @pliant
    def app(environ, start_response, arg1, arg2, foo='bar'):
        ...

### opliant(meth) | source code
    Decorate a bound wsgi callable taking args from wsgiorg.routing_args.

    class App(object):
        @opliant
        def __call__(self, environ, start_response, arg1, arg2, foo='bar'):
            ...