Commits

Robert Brewer  committed f057db3

Put some "import cpg" statements back into onStartResource methods.

  • Participants
  • Parent commits ee7f5fd
  • Branches cherrypy

Comments (0)

Files changed (4)

File lib/filter/cachefilter.py

         self.maxsize = maxsize
         self.maxobjects = maxobjects
     
-    def beforeMain(self):
+    def onStartResource(self):
         # We have to dynamically import cpg because Python can't handle
         #   circular module imports :-(
         global cpg
         from cherrypy import cpg
+    
+    def beforeMain(self):
         if not cpg.config.get('cacheFilter.on', False):
             return
         

File lib/filter/logdebuginfofilter.py

 class LogDebugInfoFilter(BaseFilter):
     """Filter that adds debug information to the page"""
     
-    def beforeMain(self):
+    def onStartResource(self):
         # We have to dynamically import cpg because Python can't handle
         #   circular module imports :-(
         global cpg
         from cherrypy import cpg
+    
+    def beforeMain(self):
         cpg.request.startBuilTime = time.time()
     
     def beforeFinalize(self):

File lib/filter/sessionfilter.py

 
 class SessionFilter(BaseFilter):
     
-    def beforeMain(self):
+    def onStartResource(self):
         # We have to dynamically import cpg because Python can't handle
         #   circular module imports :-(
         global cpg, _cputil
         from cherrypy import cpg, _cputil
+        cpg.threadData.sessionFilterOn = False
+    
+    def beforeMain(self):
         cpg.threadData.sessionFilterOn = bool(cpg.config.get('session.storageType'))
-        
         if cpg.threadData.sessionFilterOn:
             cleanupSessionData()
             if not cpg.request.isStatic:

File lib/filter/xmlrpcfilter.py

         result = result and ct in ['text/xml']
         return result
     
-    def beforeRequestBody(self):
-        """ Called after the request header has been read/parsed"""
+    def onStartResource(self):
         # We have to dynamically import cpg because Python can't handle
         #   circular module imports :-(
         global cpg
         from cherrypy import cpg
+    
+    def beforeRequestBody(self):
+        """ Called after the request header has been read/parsed"""
         cpg.threadData.xmlRpcFilterOn = cpg.config.get('xmlRpcFilter.on', False)
-        
         if not cpg.threadData.xmlRpcFilterOn:
             return True