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

Changeset 1487

Show
Ignore:
Timestamp:
12/09/06 13:29:20
Author:
fumanchu
Message:

2.x backport of [1098] (moved the profiler setup into _cprequest (so it's all in one place now)).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpengine.py

    r1486 r1487  
    99import cherrypy 
    1010from cherrypy import _cphttptools, filters 
    11 from cherrypy.lib import autoreload, profiler, cptools 
     11from cherrypy.lib import autoreload, cptools 
    1212 
    1313# Use a flag to indicate the state of the application server. 
     
    6262            and conf('session.storage_type') == 'file'): 
    6363            cherrypy._sessionFileLock = threading.RLock() 
    64          
    65         # Set up the profiler if requested. 
    66         if conf("profiling.on", False): 
    67             ppath = conf("profiling.path", "") 
    68             cherrypy.profiler = profiler.Profiler(ppath) 
    69         else: 
    70             cherrypy.profiler = None 
    7164         
    7265        # Initialize the built in filters 
  • branches/cherrypy-2.x/cherrypy/_cphttptools.py

    r1486 r1487  
    99from cherrypy import _cputil, _cpcgifs 
    1010from cherrypy.filters import applyFilters 
    11 from cherrypy.lib import cptools, httptools 
     11from cherrypy.lib import cptools, httptools, profiler 
    1212 
    1313 
     
    6767        self.simpleCookie = self.simple_cookie # Backward compatibility 
    6868         
    69         if cherrypy.profiler: 
     69        # Set up the profiler if requested. 
     70        conf = cherrypy.config.get 
     71        if conf("profiling.on", False): 
     72            p = getattr(cherrypy, "profiler", None) 
     73            if p is None: 
     74                ppath = conf("profiling.path", "") 
     75                p = cherrypy.profiler = profiler.Profiler(ppath) 
    7076            cherrypy.profiler.run(self._run) 
    7177        else: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets