Commits

Robert Brewer committed 73dfb56

More doc updates.

Comments (0)

Files changed (3)

cherrypy/__init__.py

     server.quickstart()
     engine.start()
 
+
 try:
     from threading import local as _local
 except ImportError:
     from cherrypy._cpthreadinglocal import local as _local
 
-# Create a threadlocal object to hold the request, response, and other
-# objects. In this way, we can easily dump those objects when we stop/start
-# a new HTTP conversation, yet still refer to them as module-level globals
-# in a thread-safe way.
 class _Serving(_local):
     """An interface for registering request and response objects.
     
     Rather than have a separate "thread local" object for the request and
     the response, this class works as a single threadlocal container for
-    both objects.
+    both objects (and any others which developers wish to define). In this
+    way, we can easily dump those objects when we stop/start a new HTTP
+    conversation, yet still refer to them as module-level globals in a
+    thread-safe way.
     """
     
     __metaclass__ = _AttributeDocstrings
         """Remove all attributes of self."""
         self.__dict__.clear()
 
+# The name "_serving" should be removed in 3.1.
 serving = _serving = _Serving()
 
 
 response = _ThreadLocalProxy('response')
 
 # Create thread_data object as a thread-specific all-purpose storage
-thread_data = _local()
+class _ThreadData(_local):
+    """A container for thread-specific data."""
+thread_data = _ThreadData()
 
 
 # Monkeypatch pydoc to allow help() to go through the threadlocal proxy.

cherrypy/_cplogging.py

         self.access_log.setLevel(logging.INFO)
     
     def error(self, msg='', context='', severity=logging.DEBUG, traceback=False):
-        """Write to the 'error' log.
+        """Write to the error log.
         
         This is not just for errors! Applications may call this at any time
         to log application-specific information.
         self.error_log.log(severity, ' '.join((self.time(), context, msg)))
     
     def __call__(self, *args, **kwargs):
+        """Write to the error log.
+        
+        This is not just for errors! Applications may call this at any time
+        to log application-specific information.
+        """
         return self.error(*args, **kwargs)
     
     def access(self):
     def _set_screen(self, newvalue):
         self._set_screen_handler(self.error_log, newvalue)
         self._set_screen_handler(self.access_log, newvalue)
-    screen = property(_get_screen, _set_screen)
+    screen = property(_get_screen, _set_screen,
+                      doc="If True, error and access will print to stdout.")
     
     
     # -------------------------- File handlers -------------------------- #
         return ''
     def _set_error_file(self, newvalue):
         self._set_file_handler(self.error_log, newvalue)
-    error_file = property(_get_error_file, _set_error_file)
+    error_file = property(_get_error_file, _set_error_file,
+                          doc="The filename for self.error_log.")
     
     def _get_access_file(self):
         h = self._get_builtin_handler(self.access_log, "file")
         return ''
     def _set_access_file(self, newvalue):
         self._set_file_handler(self.access_log, newvalue)
-    access_file = property(_get_access_file, _set_access_file)
+    access_file = property(_get_access_file, _set_access_file,
+                           doc="The filename for self.access_log.")
 

cherrypy/wsgiserver/__init__.py

 The CherryPy WSGI server can serve as many WSGI applications
 as you want in one instance:
 
-    wsgi_apps = [('/', my_crazy_app), (/blog', my_blog_app)]
+    wsgi_apps = [('/', my_crazy_app), ('/blog', my_blog_app)]
 
 """
 
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.