Package wsgiwapi :: Module application :: Class MethodSwitch
[frames] | no frames]

Class MethodSwitch

source code

object --+
         |
        MethodSwitch

Class for switching callables by request method.

In wsgiwapi.make_application, instances of this class can be substituted for callables, e.g.:

make_application({'foo': MethodSwitch(foo_get, foo_post, default=foo_other)})

If the default handler is supplied, it will be called for any request method not explicitly specified.

Instance Methods
 
__init__(self, get=None, post=None, put=None, delete=None, head=None, options=None, trace=None, connect=None, default=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, request, pathinfo) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, get=None, post=None, put=None, delete=None, head=None, options=None, trace=None, connect=None, default=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)