Package cherrypy :: Module _cptools :: Class Tool
[hide private]
[frames] | no frames]

Class Tool

source code

object --+
         |
        Tool
Known Subclasses:

A registered function for use with CherryPy request-processing hooks.

help(tool.callable) should give you more information about this Tool.

Instance Methods [hide private]
 
__init__(self, point, callable, name=None, priority=50)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_setargs(self)
Copy func parameter names to obj attributes.
source code
 
_merged_args(self, d=None) source code
 
__call__(self, *args, **kwargs)
Compile-time decorator (turn on the tool in config).
source code
 
_setup(self)
Hook this tool into cherrypy.request.
source code

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

Class Variables [hide private]
  namespace = 'tools'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, point, callable, name=None, priority=50)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__call__(self, *args, **kwargs)
(Call operator)

source code 
Compile-time decorator (turn on the tool in config).

For example:

    @tools.proxy()
    def whats_my_base(self):
        return cherrypy.request.base
    whats_my_base.exposed = True

_setup(self)

source code 

Hook this tool into cherrypy.request.

The standard CherryPy request object will automatically call this method when the tool is "turned on" in config.