Package cherrypy :: Module _cptree :: Class Tree
[hide private]
[frames] | no frames]

Class Tree

source code

object --+
         |
        Tree

A registry of CherryPy applications, mounted at diverse points.

An instance of this class may also be used as a WSGI callable (WSGI application object), in which case it dispatches to all mounted apps.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
mount(self, root, script_name='', config=None)
Mount a new app from a root object, script_name, and config.
source code
 
graft(self, wsgi_callable, script_name='')
Mount a wsgi callable at the given script_name.
source code
 
script_name(self, path=None)
The script_name of the app at the given path, or None.
source code
 
__call__(self, environ, start_response) source code

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

Class Variables [hide private]
  apps = {}
  apps__doc = '\n A dict of the form {script name: applicatio...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

mount(self, root, script_name='', config=None)

source code 
Mount a new app from a root object, script_name, and config.

root: an instance of a "controller class" (a collection of page
    handler methods) which represents the root of the application.
    This may also be an Application instance, or None if using
    a dispatcher other than the default.
script_name: a string containing the "mount point" of the application.
    This should start with a slash, and be the path portion of the
    URL at which to mount the given root. For example, if root.index()
    will handle requests to "http://www.example.com:8080/dept/app1/",
    then the script_name argument would be "/dept/app1".
    
    It MUST NOT end in a slash. If the script_name refers to the
    root of the URI, it MUST be an empty string (not "/").
config: a file or dict containing application config.

script_name(self, path=None)

source code 

The script_name of the app at the given path, or None.

If path is None, cherrypy.request is used.


Class Variable Details [hide private]

apps__doc

Value:
'''
    A dict of the form {script name: application}, where "script name"
    is a string declaring the URI mount point (no trailing slash), and
    "application" is an instance of cherrypy.Application (or an arbitr\
ary
    WSGI callable if you happen to be using a WSGI server).'''