Changeset 1615
- Timestamp:
- 02/08/07 12:22:47
- Files:
-
- trunk/cherrypy/__init__.py (modified) (5 diffs)
- trunk/cherrypy/_cplogging.py (modified) (5 diffs)
- trunk/cherrypy/wsgiserver/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1611 r1615 182 182 engine.start() 183 183 184 184 185 try: 185 186 from threading import local as _local … … 187 188 from cherrypy._cpthreadinglocal import local as _local 188 189 189 # Create a threadlocal object to hold the request, response, and other190 # objects. In this way, we can easily dump those objects when we stop/start191 # a new HTTP conversation, yet still refer to them as module-level globals192 # in a thread-safe way.193 190 class _Serving(_local): 194 191 """An interface for registering request and response objects. … … 196 193 Rather than have a separate "thread local" object for the request and 197 194 the response, this class works as a single threadlocal container for 198 both objects. 195 both objects (and any others which developers wish to define). In this 196 way, we can easily dump those objects when we stop/start a new HTTP 197 conversation, yet still refer to them as module-level globals in a 198 thread-safe way. 199 199 """ 200 200 … … 220 220 self.__dict__.clear() 221 221 222 # The name "_serving" should be removed in 3.1. 222 223 serving = _serving = _Serving() 223 224 … … 276 277 277 278 # Create thread_data object as a thread-specific all-purpose storage 278 thread_data = _local() 279 class _ThreadData(_local): 280 """A container for thread-specific data.""" 281 thread_data = _ThreadData() 279 282 280 283 trunk/cherrypy/_cplogging.py
r1564 r1615 31 31 32 32 def error(self, msg='', context='', severity=logging.DEBUG, traceback=False): 33 """Write to the 'error'log.33 """Write to the error log. 34 34 35 35 This is not just for errors! Applications may call this at any time … … 41 41 42 42 def __call__(self, *args, **kwargs): 43 """Write to the error log. 44 45 This is not just for errors! Applications may call this at any time 46 to log application-specific information. 47 """ 43 48 return self.error(*args, **kwargs) 44 49 … … 100 105 self._set_screen_handler(self.error_log, newvalue) 101 106 self._set_screen_handler(self.access_log, newvalue) 102 screen = property(_get_screen, _set_screen) 107 screen = property(_get_screen, _set_screen, 108 doc="If True, error and access will print to stdout.") 103 109 104 110 … … 134 140 def _set_error_file(self, newvalue): 135 141 self._set_file_handler(self.error_log, newvalue) 136 error_file = property(_get_error_file, _set_error_file) 142 error_file = property(_get_error_file, _set_error_file, 143 doc="The filename for self.error_log.") 137 144 138 145 def _get_access_file(self): … … 143 150 def _set_access_file(self, newvalue): 144 151 self._set_file_handler(self.access_log, newvalue) 145 access_file = property(_get_access_file, _set_access_file) 152 access_file = property(_get_access_file, _set_access_file, 153 doc="The filename for self.access_log.") 146 154 trunk/cherrypy/wsgiserver/__init__.py
r1599 r1615 36 36 as you want in one instance: 37 37 38 wsgi_apps = [('/', my_crazy_app), ( /blog', my_blog_app)]38 wsgi_apps = [('/', my_crazy_app), ('/blog', my_blog_app)] 39 39 40 40 """

