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

Changeset 1975

Show
Ignore:
Timestamp:
06/04/08 00:21:56
Author:
fumanchu
Message:

Docstring updates.

Files:

Legend:

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

    r1957 r1975  
    150150 
    151151def staticdir(section, dir, root="", match="", content_types=None, index=""): 
    152     """Serve a static resource from the given (root +) dir.""" 
     152    """Serve a static resource from the given (root +) dir. 
     153     
     154    If 'match' is given, request.path_info will be searched for the given 
     155    regular expression before attempting to serve static content. 
     156     
     157    If content_types is given, it should be a Python dictionary of 
     158    {file-extension: content-type} pairs, where 'file-extension' is 
     159    a string (e.g. "gif") and 'content-type' is the value to write 
     160    out in the Content-Type response header (e.g. "image/gif"). 
     161     
     162    If 'index' is provided, it should be the (relative) name of a file to 
     163    serve for directory requests. For example, if the dir argument is 
     164    '/home/me', the Request-URI is 'myapp', and the index arg is 
     165    'index.html', the file '/home/me/myapp/index.html' will be sought. 
     166    """ 
    153167    if match and not re.search(match, cherrypy.request.path_info): 
    154168        return False 
     
    191205 
    192206def staticfile(filename, root=None, match="", content_types=None): 
    193     """Serve a static resource from the given (root +) filename.""" 
     207    """Serve a static resource from the given (root +) filename. 
     208     
     209    If 'match' is given, request.path_info will be searched for the given 
     210    regular expression before attempting to serve static content. 
     211     
     212    If content_types is given, it should be a Python dictionary of 
     213    {file-extension: content-type} pairs, where 'file-extension' is 
     214    a string (e.g. "gif") and 'content-type' is the value to write 
     215    out in the Content-Type response header (e.g. "image/gif"). 
     216    """ 
    194217    if match and not re.search(match, cherrypy.request.path_info): 
    195218        return False 

Hosted by WebFaction

Log in as guest/cpguest to create tickets