Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1604

Show
Ignore:
Timestamp:
01/21/07 21:50:48
Author:
fumanchu
Message:

Docstring updates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpdispatch.py

    r1597 r1604  
    1 """CherryPy dispatchers.""" 
     1"""CherryPy dispatchers. 
     2 
     3A 'dispatcher' is the object which looks up the 'page handler' callable 
     4and collects config for the current request based on the path_info, other 
     5request attributes, and the application architecture. The core calls the 
     6dispatcher as early as possible, passing it a 'path_info' argument. 
     7 
     8The default dispatcher discovers the page handler by matching path_info 
     9to a hierarchical arrangement of objects, starting at request.app.root. 
     10""" 
    211 
    312import cherrypy 
  • trunk/cherrypy/_cprequest.py

    r1602 r1604  
    1919     
    2020    callback = None 
    21     callback__doc = """The bare callable that this Hook object is wrapping. 
    22     This will be called when the Hook is called.""" 
     21    callback__doc = """ 
     22    The bare callable that this Hook object is wrapping, which will 
     23    be called when the Hook is called.""" 
    2324     
    2425    failsafe = False 
    25     failsafe__doc = """If True, the callback is guaranteed to run even if 
    26     other callbacks from the same call point raise exceptions.""" 
     26    failsafe__doc = """ 
     27    If True, the callback is guaranteed to run even if other callbacks 
     28    from the same call point raise exceptions.""" 
    2729     
    2830    priority = 50 
    29     priority__doc = """Defines the order of execution for a list of Hooks. 
    30     Priority numbers should be limited to the closed interval [0, 100], but 
    31     values outside this range are acceptable, as are fractional values.""" 
     31    priority__doc = """ 
     32    Defines the order of execution for a list of Hooks. Priority numbers 
     33    should be limited to the closed interval [0, 100], but values outside 
     34    this range are acceptable, as are fractional values.""" 
    3235     
    3336    kwargs = {} 
    34     kwargs__doc = """A set of keyword arguments that will be passed 
    35     to the callable on each call.""" 
     37    kwargs__doc = """ 
     38    A set of keyword arguments that will be passed to the 
     39    callable on each call.""" 
    3640     
    3741    def __init__(self, callback, failsafe=None, priority=None, **kwargs): 
     
    105109        return newmap 
    106110    copy = __copy__ 
     111     
     112    def __repr__(self): 
     113        cls = self.__class__ 
     114        return "%s.%s(points=%r)" % (cls.__module__, cls.__name__, self.keys()) 
    107115 
    108116 
     
    180188     
    181189    base = "" 
    182     base__doc = """The 'base' (scheme + host) portion of the requested URL.""" 
     190    base__doc = """The (scheme://host) portion of the requested URL.""" 
    183191     
    184192    # Request-Line attributes 
    185193    request_line = "" 
    186194    request_line__doc = """ 
    187     The complete Request Line received from the client. This is a 
     195    The complete Request-Line received from the client. This is a 
    188196    single string consisting of the request method, URI, and protocol 
    189197    version (joined by spaces). Any final CRLF is removed.""" 
     
    201209    The query component of the Request-URI, a string of information to be 
    202210    interpreted by the resource. The query portion of a URI follows the 
    203     path component, and is spearated by a '?'. For example, the URI 
     211    path component, and is separated by a '?'. For example, the URI 
    204212    'http://www.cherrypy.org/wiki?a=3&b=4' has the query component, 
    205213    'a=3&b=4'.""" 
     
    227235     
    228236    headers = http.HeaderMap() 
     237    headers__doc = """ 
     238    A dict-like object containing the request headers. Keys are header 
     239    names (in Title-Case format); however, you may get and set them in 
     240    a case-insensitive manner. That is, headers['Content-Type'] and 
     241    headers['content-type'] refer to the same value. Values are header 
     242    values (decoded according to RFC 2047 if necessary). See also: 
     243    http.HeaderMap, http.HeaderElement.""" 
     244     
    229245    cookie = Cookie.SimpleCookie() 
     246    cookie__doc = """See help(Cookie).""" 
    230247     
    231248    rfile = None 
     
    269286    # Dispatch attributes 
    270287    dispatch = cherrypy.dispatch.Dispatcher() 
     288    dispatch__doc = """ 
     289    The object which looks up the 'page handler' callable and collects 
     290    config for the current request based on the path_info, other 
     291    request attributes, and the application architecture. The core 
     292    calls the dispatcher as early as possible, passing it a 'path_info' 
     293    argument. 
     294     
     295    The default dispatcher discovers the page handler by matching path_info 
     296    to a hierarchical arrangement of objects, starting at request.app.root. 
     297    See help(cherrypy.dispatch) for more information.""" 
    271298     
    272299    script_name = "" 
     
    281308     
    282309    app = None 
    283     app__doc = """The Application object which is handling this request.""" 
     310    app__doc = \ 
     311        """The cherrypy.Application object which is handling this request.""" 
    284312     
    285313    handler = None 
     
    310338    is_index__doc = """ 
    311339    This will be True if the current request is mapped to an 'index' 
    312     resource handler (or a 'default' handler if path_info ends with 
     340    resource handler (also, a 'default' handler if path_info ends with 
    313341    a slash). The value may be used to automatically redirect the 
    314342    user-agent to a 'more canonical' URL which either adds or removes 
     
    316344     
    317345    hooks = HookMap(hookpoints) 
     346    hooks__doc = """ 
     347    A HookMap (dict-like object) of the form: {hookpoint: [hook, ...]}. 
     348    Each key is a str naming the hook point, and each value is a list 
     349    of hooks which will be called at that hook point during this request. 
     350    The list of hooks is generally populated as early as possible (mostly 
     351    from Tools specified in config), but may be extended at any time. 
     352    See also: _cprequest.Hook, _cprequest.HookMap, and cherrypy.tools.""" 
    318353     
    319354    error_response = cherrypy.HTTPError(500).set_response 
    320355    error_response__doc = """ 
    321     The callable which will handle unexpected errors during request 
    322     processing. By default, it uses HTTPError(500) to return an error 
    323     response to the user-agent.""" 
     356    The no-arg callable which will handle unexpected, untrapped errors 
     357    during request processing. This is not used for expected exceptions 
     358    (like NotFound, HTTPError, or HTTPRedirect) which are raised in 
     359    response to expected conditions (those should be customized either 
     360    via request.error_page or by overriding HTTPError.set_response). 
     361    By default, error_response uses HTTPError(500) to return a generic 
     362    error response to the user-agent.""" 
    324363     
    325364    error_page = {} 
     
    327366    A dict of {error code: response filename} pairs. The named response 
    328367    files should be Python string-formatting templates, and can expect by 
    329     default to receive the keyword-formatted values 'status', 'message', 
    330     'traceback', and 'version'. The set of keyword values can be extended 
    331     by overriding HTTPError.set_response.""" 
     368    default to receive the format values with the mapping keys 'status', 
     369    'message', 'traceback', and 'version'. The set of format mappings 
     370    can be extended by overriding HTTPError.set_response.""" 
    332371     
    333372    show_tracebacks = True 
     
    337376     
    338377    throws = (KeyboardInterrupt, SystemExit, cherrypy.InternalRedirect) 
    339     throws__doc = """The sequence of exceptions which Request.run does not trap.""" 
     378    throws__doc = \ 
     379        """The sequence of exceptions which Request.run does not trap.""" 
    340380     
    341381    throw_errors = False 
     
    685725    # Class attributes for dev-time introspection. 
    686726    status = "" 
     727    status__doc = """The HTTP Status-Code and Reason-Phrase.""" 
     728     
    687729    header_list = [] 
     730    header_list__doc = """ 
     731    A list of the HTTP response headers as (name, value) tuples. 
     732    In general, you should use response.headers (a dict) instead.""" 
     733     
    688734    headers = http.HeaderMap() 
     735    headers__doc = """ 
     736    A dict-like object containing the response headers. Keys are header 
     737    names (in Title-Case format); however, you may get and set them in 
     738    a case-insensitive manner. That is, headers['Content-Type'] and 
     739    headers['content-type'] refer to the same value. Values are header 
     740    values (decoded according to RFC 2047 if necessary). See also: 
     741    http.HeaderMap, http.HeaderElement.""" 
     742     
    689743    cookie = Cookie.SimpleCookie() 
     744    cookie__doc = """See help(Cookie).""" 
     745     
    690746    body = Body() 
     747    body__doc = """The body (entity) of the HTTP response.""" 
     748     
    691749    time = None 
     750    time__doc = """The value of time.time() when created. Use in HTTP dates.""" 
     751     
    692752    timeout = 300 
     753    timeout__doc = """Seconds after which the response will be aborted.""" 
     754     
    693755    timed_out = False 
     756    timed_out__doc = """ 
     757    Flag to indicate the response should be aborted, because it has 
     758    exceeded its timeout.""" 
     759     
    694760    stream = False 
     761    stream__doc = """If False, buffer the response body.""" 
    695762     
    696763    def __init__(self): 
     
    711778     
    712779    def collapse_body(self): 
     780        """Iterate over self.body, replacing it with and returning the result.""" 
    713781        newbody = ''.join([chunk for chunk in self.body]) 
    714782        self.body = newbody 
  • trunk/cherrypy/lib/http.py

    r1602 r1604  
    329329    Each key is changed on entry to str(key).title(). This allows headers 
    330330    to be case-insensitive and avoid duplicates. 
     331     
     332    Values are header values (decoded according to RFC 2047 if necessary). 
    331333    """ 
    332334     

Hosted by WebFaction

Log in as guest/cpguest to create tickets