Changeset 983
- Timestamp:
- 02/28/06 09:43:56
- Files:
-
- trunk/cherrypy/filters/sessionfilter.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/filters/sessionfilter.py
r979 r983 53 53 class SessionNotEnabledError(Exception): 54 54 """ User forgot to set session_filter.on to True """ 55 pass 56 57 class SessionStoragePathNotConfiguredError(Exception): 58 """ 59 User set storage_type to file but forgot to set the storage_path 60 """ 55 61 pass 56 62 … … 288 294 289 295 def clean_up(self, sess): 290 storage Path = cherrypy.config.get('session_filter.storage_path')296 storage_path = cherrypy.config.get('session_filter.storage_path') 291 297 now = datetime.datetime.now() 292 298 # Iterate over all files in the dir/ and exclude non session files 293 299 # and lock files 294 for fname in os.listdir(storage Path):300 for fname in os.listdir(storage_path): 295 301 if (fname.startswith(self.SESSION_PREFIX) 296 302 and not fname.endswith(self.LOCK_SUFFIX)): 297 303 # We have a session file: try to load it and check 298 304 # if it's expired. If it fails, nevermind. 299 filePath = os.path.join(storage Path, fname)305 filePath = os.path.join(storage_path, fname) 300 306 try: 301 307 f = open(filePath, "rb") … … 312 318 313 319 def _getFilePath(self, id): 314 storagePath = cherrypy.config.get('session_filter.storage_path') 320 storage_path = cherrypy.config.get('session_filter.storage_path') 321 if storage_path is None: 322 raise SessionStoragePathNotConfiguredError() 315 323 fileName = self.SESSION_PREFIX + id 316 filePath = os.path.join(storage Path, fileName)324 filePath = os.path.join(storage_path, fileName) 317 325 return filePath 318 326

