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

Class Application

source code

object --+
         |
        Application

A CherryPy Application.
    
    Servers and gateways should not instantiate Request objects directly.
    Instead, they should ask an Application object for a request object.
    
    An instance of this class may also be used as a WSGI callable
    (WSGI application object) for itself.
    

config [= {}]:
    
    A dict of {path: pathconf} pairs, where 'pathconf' is itself a dict
    of {key: value} pairs.

log [= None]:
    A LogManager instance. See _cplogging.

root [= None]:
    
    The top-most container of page handlers for this app. Handlers should
    be arranged in a hierarchy of attributes, matching the expected URI
    hierarchy; the default dispatcher then searches this hierarchy for a
    matching handler. When using a dispatcher other than the default,
    this value may be None.

script_name [= <property object at 0x85721e4>]:
    
    The URI "mount point" for this app. A mount point is that portion of
    the URI which is constant for all URIs that are serviced by this
    application; it does not include scheme, host, or proxy ("virtual host")
    portions of the URI.
    
    For example, if script_name is "/my/cool/app", then the URL
    "http://www.example.com/my/cool/app/page1" might be handled by a
    "page1" method on the root object.
    
    The value of script_name MUST NOT end in a slash. If the script_name
    refers to the root of the URI, it MUST be an empty string (not "/").
    
    If script_name is explicitly set to None, then the script_name will be
    provided for each call from request.wsgi_environ['SCRIPT_NAME'].
    

wsgiapp [= None]:
    A CPWSGIApp instance. See _cpwsgi.

Nested Classes [hide private]
  __metaclass__
Metaclass for declaring docstrings for class attributes.
  request_class
An HTTP request.
  response_class
An HTTP Response, including status, headers, and body.
Instance Methods [hide private]
 
__init__(self, root, script_name='', config=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__repr__(self)
repr(x)
source code
 
_get_script_name(self) source code
 
_set_script_name(self, value) source code
 
merge(self, config)
Merge the given config into self.config.
source code
 
get_serving(self, local, remote, scheme, sproto)
Create and return a Request and Response object.
source code
 
release_serving(self)
Release the current serving (request and response).
source code
 
__call__(self, environ, start_response) source code

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

Class Variables [hide private]
  root = None
hash(x)
  root__doc = ...
  config = {}
  config__doc = ...
  namespaces = cherrypy._cpconfig.NamespaceSet({})
  toolboxes = {'tools': cherrypy.tools}
  log = None
hash(x)
  log__doc = """A LogManager instance. See _cplogging."""
  wsgiapp = None
hash(x)
  wsgiapp__doc = """A CPWSGIApp instance. See _cpwsgi."""
  relative_urls = False
  script_name__doc = ...
Properties [hide private]
  script_name
The URI "mount point" for this app.

Inherited from object: __class__

Method Details [hide private]

__init__(self, root, script_name='', config=None)
(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]

root__doc

Value:
"""
    The top-most container of page handlers for this app. Handlers sho\
uld
    be arranged in a hierarchy of attributes, matching the expected UR\
I
    hierarchy; the default dispatcher then searches this hierarchy for\
 a
    matching handler. When using a dispatcher other than the default,
...

config__doc

Value:
"""
    A dict of {path: pathconf} pairs, where 'pathconf' is itself a dic\
t
    of {key: value} pairs."""

script_name__doc

Value:
"""
    The URI "mount point" for this app. A mount point is that portion \
of
    the URI which is constant for all URIs that are serviced by this
    application; it does not include scheme, host, or proxy ("virtual \
host")
    portions of the URI.
    
...

Property Details [hide private]

script_name

The URI "mount point" for this app. A mount point is that portion of the URI which is constant for all URIs that are serviced by this application; it does not include scheme, host, or proxy ("virtual host") portions of the URI.

For example, if script_name is "/my/cool/app", then the URL "http://www.example.com/my/cool/app/page1" might be handled by a "page1" method on the root object.

The value of script_name MUST NOT end in a slash. If the script_name refers to the root of the URI, it MUST be an empty string (not "/").

If script_name is explicitly set to None, then the script_name will be provided for each call from request.wsgi_environ['SCRIPT_NAME'].

Get Method:
_get_script_name(self)
Set Method:
_set_script_name(self, value)