Robert Brewer avatar Robert Brewer committed 2dbff11

Docstring updates.

Comments (0)

Files changed (1)

cherrypy/lib/static.py

         return False
 
 def staticdir(section, dir, root="", match="", content_types=None, index=""):
-    """Serve a static resource from the given (root +) dir."""
+    """Serve a static resource from the given (root +) dir.
+    
+    If 'match' is given, request.path_info will be searched for the given
+    regular expression before attempting to serve static content.
+    
+    If content_types is given, it should be a Python dictionary of
+    {file-extension: content-type} pairs, where 'file-extension' is
+    a string (e.g. "gif") and 'content-type' is the value to write
+    out in the Content-Type response header (e.g. "image/gif").
+    
+    If 'index' is provided, it should be the (relative) name of a file to
+    serve for directory requests. For example, if the dir argument is
+    '/home/me', the Request-URI is 'myapp', and the index arg is
+    'index.html', the file '/home/me/myapp/index.html' will be sought.
+    """
     if match and not re.search(match, cherrypy.request.path_info):
         return False
     
     return handled
 
 def staticfile(filename, root=None, match="", content_types=None):
-    """Serve a static resource from the given (root +) filename."""
+    """Serve a static resource from the given (root +) filename.
+    
+    If 'match' is given, request.path_info will be searched for the given
+    regular expression before attempting to serve static content.
+    
+    If content_types is given, it should be a Python dictionary of
+    {file-extension: content-type} pairs, where 'file-extension' is
+    a string (e.g. "gif") and 'content-type' is the value to write
+    out in the Content-Type response header (e.g. "image/gif").
+    """
     if match and not re.search(match, cherrypy.request.path_info):
         return False
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.