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

Changeset 1072

Show
Ignore:
Timestamp:
04/25/06 23:58:08
Author:
fumanchu
Message:

Removed old_name option from get_special_attribute.

Files:

Legend:

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

    r1067 r1072  
    8787    # to allow profiler and coverage tools to work on it. 
    8888    import _cputil 
    89     logfunc = _cputil.get_special_attribute('_cp_log_message', '_cpLogMessage'
     89    logfunc = _cputil.get_special_attribute('_cp_log_message'
    9090     
    9191    if traceback: 
  • trunk/cherrypy/_cperror.py

    r1047 r1072  
    153153    def set_response(self): 
    154154        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"
    156156        handler(self.status, self.message) 
    157157 
  • trunk/cherrypy/_cputil.py

    r1071 r1072  
    6060    return objectTrail 
    6161 
    62 def get_special_attribute(name, old_name = None): 
     62def get_special_attribute(name): 
    6363    """Return the special attribute. A special attribute is one that 
    6464    applies to all of the children from where it is defined, such as 
     
    7373    objectList.reverse() 
    7474    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): 
    7876            return getattr(obj, name) 
    7977        if obj in mounted_app_roots: 
     
    8179     
    8280    try: 
    83         if old_name: 
    84             return globals()[old_name] 
    85         else: 
    86             return globals()[name] 
     81        return globals()[name] 
    8782    except KeyError: 
    88         if old_name: 
    89             return get_special_attribute(name) 
    9083        msg = "Special attribute %s could not be found" % repr(name) 
    9184        raise cherrypy.HTTPError(500, msg) 
     
    239232        and cherrypy.config.get('server.log_unhandled_tracebacks', True)): 
    240233        cherrypy.log(traceback=True) 
    241      
    242234    cherrypy.HTTPError(500).set_response() 
    243235 

Hosted by WebFaction

Log in as guest/cpguest to create tickets