Anonymous avatar Anonymous committed ed8c59b

renamed sessionconfig.get =sessionconfig.retrieve to avoid confustion

Comments (0)

Files changed (4)

cherrypy/lib/filter/sessionfilter/basesession.py

     def getDefaultAttributes(self):
       return { 
                'timestamp'  : int(time.time()),
-               'timeout'    : sessionconfig.get('timeout', self.sessionName) * 60,
+               'timeout'    : sessionconfig.retrieve('timeout', self.sessionName) * 60,
                'lastAccess' : int(time.time()),
                'key' : self.generateSessionKey()
              }
 
     def generateSessionKey(self):
         """ Function to return a new sessioId """
-        sessionKeyFunc = sessionconfig.get('keyGenerator', self.sessionName, None)
+        sessionKeyFunc = sessionconfig.retrieve('keyGenerator', self.sessionName, None)
         
         if sessionKeyFunc:
             newKey = cherrypy._cputil.getSpecialAttribute(sessionKeyFunc)()
         session.threadCount = 0
         self.setSession(session)
         
-        cacheTimeout = sessionconfig.get('%s.cacheTimeout' % self.sessionName, None)
+        cacheTimeout = sessionconfig.retrieve('%s.cacheTimeout' % self.sessionName, None)
         if not cacheTimeout:
-            cacheTimeout = sessionconfig.get('sessionFilter.cacheTimeout', None)
+            cacheTimeout = sessionconfig.retrieve('sessionFilter.cacheTimeout', None)
         
         if session.threadCount == 0 and not cacheTimeout:
             del self.__sessionCache[sessionKey]
     def cleanUpCache(self):
         """ cleanup all inactive sessions """
         
-        cacheTimeout = sessionconfig.get('%s.cacheTimeout' % self.sessionName, None)
+        cacheTimeout = sessionconfig.retrieve('%s.cacheTimeout' % self.sessionName, None)
         
         # don't waste cycles if we aren't caching inactive sessions
         if cacheTimeout:

cherrypy/lib/filter/sessionfilter/filesession.py

 
     def __storageDir(self):
         cpg = cherrypy.cpg
-        storageDir = sessionconfig.get('storageFileDir', self.sessionName, '.sessionFiles')
+        storageDir = sessionconfig.retrieve('storageFileDir', self.sessionName, '.sessionFiles')
         return storageDir
     
     # all session writes are blocked 

cherrypy/lib/filter/sessionfilter/sessionconfig.py

  
 import cherrypy.cpg
 
-def get(keyName, sessionName, default = None):
+def retrieve(keyName, sessionName, default = None):
     cpg = cherrypy.cpg
     value = cpg.config.get('%s.%s' % (sessionName, keyName), None)
     if value == None:

cherrypy/lib/filter/sessionfilter/sessionfilter.py

         sessionName = sessionNames[sessionPath]
         sessionManager = cpg.config.get('%s.sessionManager' % sessionName, None)
         if not sessionManager:
-            storageType = sessionconfig.get('storageType', sessionName)
+            storageType = sessionconfig.retrieve('storageType', sessionName)
             
             try:
                 sessionManager = sessionconfig._sessionTypes[storageType](sessionName)
                               }
                              )
         else: # try and clean up
-            cleanUpDelay = sessionconfig.get('cleanUpDelay', sessionName)
+            cleanUpDelay = sessionconfig.retrieve('cleanUpDelay', sessionName)
             now = time.time()
             lastCleanUp = sessionManager.lastCleanUp
             if lastCleanUp + cleanUpDelay * 60 <= now:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.