Package cherrypy :: Module _cprequest :: Class Hook
[hide private]
[frames] | no frames]

Class Hook

source code

object --+
         |
        Hook

A callback and its metadata: failsafe, priority, and kwargs.

callback [= None]:
    
    The bare callable that this Hook object is wrapping, which will
    be called when the Hook is called.

failsafe [= False]:
    
    If True, the callback is guaranteed to run even if other callbacks
    from the same call point raise exceptions.

kwargs [= {}]:
    
    A set of keyword arguments that will be passed to the
    callable on each call.

priority [= 50]:
    
    Defines the order of execution for a list of Hooks. Priority numbers
    should be limited to the closed interval [0, 100], but values outside
    this range are acceptable, as are fractional values.

Nested Classes [hide private]
  __metaclass__
Metaclass for declaring docstrings for class attributes.
Instance Methods [hide private]
 
__init__(self, callback, failsafe=None, priority=None, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__cmp__(self, other) source code
 
__call__(self)
Run self.callback(**self.kwargs).
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  callback = None
hash(x)
  callback__doc = ...
  failsafe = False
  failsafe__doc = ...
  priority = 50
  priority__doc = ...
  kwargs = {}
  kwargs__doc = ...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, callback, failsafe=None, priority=None, **kwargs)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Class Variable Details [hide private]

callback__doc

Value:
"""
    The bare callable that this Hook object is wrapping, which will
    be called when the Hook is called."""

failsafe__doc

Value:
"""
    If True, the callback is guaranteed to run even if other callbacks
    from the same call point raise exceptions."""

priority__doc

Value:
"""
    Defines the order of execution for a list of Hooks. Priority numbe\
rs
    should be limited to the closed interval [0, 100], but values outs\
ide
    this range are acceptable, as are fractional values."""

kwargs__doc

Value:
"""
    A set of keyword arguments that will be passed to the
    callable on each call."""