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

Changeset 828

Show
Ignore:
Timestamp:
11/20/05 20:41:03
Author:
fumanchu
Message:

Made profiler output more readable by prepending init.py modules' parent folders.

Files:

Legend:

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

    r768 r828  
    3232""" 
    3333 
     34 
     35# Make profiler output more readable by adding __init__ modules' parents. 
     36def new_func_strip_path(func_name): 
     37    filename, line, name = func_name 
     38    if filename.endswith("__init__.py"): 
     39        return os.path.basename(filename[:-12]) + filename[-12:], line, name 
     40    return os.path.basename(filename), line, name 
     41import pstats 
     42pstats.func_strip_path = new_func_strip_path 
    3443 
    3544import hotshot 

Hosted by WebFaction

Log in as guest/cpguest to create tickets