Changeset 1072
- Timestamp:
- 04/25/06 23:58:08
- Files:
-
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/_cperror.py (modified) (1 diff)
- trunk/cherrypy/_cputil.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1067 r1072 87 87 # to allow profiler and coverage tools to work on it. 88 88 import _cputil 89 logfunc = _cputil.get_special_attribute('_cp_log_message' , '_cpLogMessage')89 logfunc = _cputil.get_special_attribute('_cp_log_message') 90 90 91 91 if traceback: trunk/cherrypy/_cperror.py
r1047 r1072 153 153 def set_response(self): 154 154 import cherrypy 155 handler = cherrypy._cputil.get_special_attribute("_cp_on_http_error" , "_cpOnHTTPError")155 handler = cherrypy._cputil.get_special_attribute("_cp_on_http_error") 156 156 handler(self.status, self.message) 157 157 trunk/cherrypy/_cputil.py
r1071 r1072 60 60 return objectTrail 61 61 62 def get_special_attribute(name , old_name = None):62 def get_special_attribute(name): 63 63 """Return the special attribute. A special attribute is one that 64 64 applies to all of the children from where it is defined, such as … … 73 73 objectList.reverse() 74 74 for objname, obj in objectList: 75 if old_name and hasattr(obj, old_name): 76 return getattr(obj, old_name) 77 elif hasattr(obj, name): 75 if hasattr(obj, name): 78 76 return getattr(obj, name) 79 77 if obj in mounted_app_roots: … … 81 79 82 80 try: 83 if old_name: 84 return globals()[old_name] 85 else: 86 return globals()[name] 81 return globals()[name] 87 82 except KeyError: 88 if old_name:89 return get_special_attribute(name)90 83 msg = "Special attribute %s could not be found" % repr(name) 91 84 raise cherrypy.HTTPError(500, msg) … … 239 232 and cherrypy.config.get('server.log_unhandled_tracebacks', True)): 240 233 cherrypy.log(traceback=True) 241 242 234 cherrypy.HTTPError(500).set_response() 243 235

