Changeset 275
- Timestamp:
- 06/10/05 22:54:24
- Files:
-
- trunk/cherrypy/_cpconfig.py (modified) (3 diffs)
- trunk/cherrypy/_cpdefaults.py (modified) (1 diff)
- trunk/cherrypy/_cphttptools.py (modified) (1 diff)
- trunk/cherrypy/_cpserver.py (modified) (1 diff)
- trunk/cherrypy/lib/filter/sessionfilter (added)
- trunk/cherrypy/lib/filter/sessionfilter.py (deleted)
- trunk/cherrypy/lib/filter/sessionfilter/__init__.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/basesession.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/dbmsession.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/filesession.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/ramsession.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/sessiondict.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/sessiondictbase.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/sessionerrors.py (added)
- trunk/cherrypy/lib/filter/sessionfilter/sessionfilter.py (added)
- trunk/cherrypy/tutorial/tut10_sessionfilter.conf (added)
- trunk/cherrypy/tutorial/tut10_sessionfilter.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpconfig.py
r274 r275 23 23 'session.cookieName': 'CherryPySession', 24 24 'session.storageFileDir': '', 25 26 'sessionFilter.on': True, 27 'sessionFilter.timeout': 60, 28 'sessionFilter.cleanUpDelay': 60, 29 'sessionFilter.storageType' : 'ram', 30 'sessionFilter.cookieName': 'CherryPySession', 31 'sessionFilter.storageFileDir': '.sessionFiles', 32 33 'sessionFilter.new': 'sessionMap', # legacy setting 25 34 } 26 35 configMap = {"/": defaultGlobal.copy()} … … 39 48 _load(file) 40 49 41 def get(key, defaultValue=None, returnSection=False ):50 def get(key, defaultValue=None, returnSection=False, startPath = None): 42 51 # Look, ma, no Python function calls! Uber-fast. 52 # start path lest you overload the starting search path (needed by getAll) 53 43 54 global cpg 44 55 if not cpg: 45 56 import cpg 46 57 47 try: 48 path = cpg.request.path 49 except AttributeError: 50 path = "/" 58 if startPath: 59 path = startPath 60 else: 61 try: 62 path = cpg.request.path 63 except AttributeError: 64 path = "/" 51 65 52 66 while True: … … 71 85 else: 72 86 return result 87 88 import os.path 89 90 def getAll(key): 91 """ 92 getAll will lookup the key in the current node and all of its parent nodes, 93 it will return a dictionary paths of each node containing the key and its value 94 95 This function is required by the session filter 96 """ 97 path = get(key, None, returnSection = True) 98 value = get(key) 99 100 result = {} 101 while value != None and path != '/': 102 result[path]= value 103 path = os.path.split(path)[0] 104 value = get(key, None, returnSection = False, startPath = path) 105 path = get(key, None, returnSection = True, startPath = path) 106 107 if path == '/' and value != None: 108 result[path] = value 109 110 return result 73 111 74 112 class CaseSensitiveConfigParser(ConfigParser.ConfigParser): trunk/cherrypy/_cpdefaults.py
r267 r275 170 170 from cherrypy.lib.filter import baseurlfilter, cachefilter, \ 171 171 decodingfilter, encodingfilter, gzipfilter, logdebuginfofilter, \ 172 s essionfilter, staticfilter, nsgmlsfilter, tidyfilter, \172 staticfilter, nsgmlsfilter, tidyfilter, \ 173 173 virtualhostfilter, xmlrpcfilter 174 175 from cherrypy.lib.filter.sessionfilter import sessionfilter 174 176 175 177 _cachefilter = cachefilter.CacheFilter() trunk/cherrypy/_cphttptools.py
r274 r275 390 390 yield chunk 391 391 chunk = input.read(chunkSize) 392 input.close() 392 393 393 394 def flattener(input): trunk/cherrypy/_cpserver.py
r267 r275 75 75 cpg.request = local() 76 76 cpg.response = local() 77 78 # Create as sessions object for accessing session data 79 cpg.sessions = local() 77 80 78 81 # Create threadData object as a thread-specific all-purpose storage

