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

Changeset 562

Show
Ignore:
Timestamp:
08/27/05 13:06:43
Author:
fumanchu
Message:

Cleaned _cphttptools.main() for more-readable tracebacks.

Files:

Legend:

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

    r561 r562  
    491491    while True: 
    492492        try: 
    493             func, objectPathList, virtualPathList = mapPathToObject(path) 
     493            page_handler, object_path, virtual_path = mapPathToObject(path) 
    494494             
    495             # Remove "root" from objectPathList and join it to get objectPath 
    496             cherrypy.request.objectPath = '/' + '/'.join(objectPathList[1:]) 
     495            # Remove "root" from object_path and join it to get objectPath 
     496            cherrypy.request.objectPath = '/' + '/'.join(object_path[1:]) 
    497497            try: 
    498                 body = func(*(virtualPathList + cherrypy.request.paramList), 
    499                             **(cherrypy.request.paramMap)
     498                args = virtual_path + cherrypy.request.paramList 
     499                body = page_handler(*args, **cherrypy.request.paramMap
    500500            except TypeError, x: 
    501501                m = re.match(r"(.*)\(\) got an unexpected keyword argument '(.*)'", x.args[0]) 
     
    504504                    msg = ("The '%s' page handler received a '%s' parameter, " 
    505505                           "which it does not handle." % (fname, pname)) 
    506                     raise TypeError(msg, repr(func)) 
     506                    raise TypeError(msg, repr(page_handler)) 
    507507            cherrypy.response.body = iterable(body) 
    508508            return 

Hosted by WebFaction

Log in as guest/cpguest to create tickets