| |
- exceptions.Exception
-
- SessionException
-
- CorruptData
- GenerateIDError
- KeyError
- MaxSessionCountExceeded
- SessionExpired
- SessionHijacked
- threading.Thread(threading._Verbose)
-
- CleanUpThread
- WebSession
class CleanUpThread(threading.Thread) |
|
Thread class for clean-up thread |
|
- Method resolution order:
- CleanUpThread
- threading.Thread
- threading._Verbose
Methods defined here:
- __init__(self, sessionInstance, interval=60)
- __repr__(self)
- join(self, timeout=0.0)
- run(self)
- Thread function for cleaning up session database
Data and non-method functions defined here:
- __doc__ = '\n Thread class for clean-up thread\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from threading.Thread:
- _Thread__bootstrap = __bootstrap(self)
- _Thread__delete = __delete(self)
- _Thread__stop = __stop(self)
- _set_daemon(self)
- getName(self)
- isAlive(self)
- isDaemon(self)
- setDaemon(self, daemonic)
- setName(self, name)
- start(self)
Data and non-method functions inherited from threading.Thread:
- _Thread__initialized = 0
- int(x[, base]) -> integer
Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string.
Methods inherited from threading._Verbose:
- _note(self, format, *args)
|
class CorruptData(SessionException) |
|
Raised if data was corrupt, e.g. UnpicklingError occured |
|
- Method resolution order:
- CorruptData
- SessionException
- exceptions.Exception
Methods defined here:
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Raised if data was corrupt, e.g. UnpicklingError occured'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from SessionException:
- __init__(self, *args)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class GenerateIDError(SessionException) |
|
Raised if generation of unique session ID failed. |
|
- Method resolution order:
- GenerateIDError
- SessionException
- exceptions.Exception
Methods defined here:
- __init__(self, maxtry)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Raised if generation of unique session ID failed.'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class KeyError(SessionException) |
|
Raised if session ID not found in session dictionary. |
|
- Method resolution order:
- KeyError
- SessionException
- exceptions.Exception
Methods defined here:
- __init__(self, session_id)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Raised if session ID not found in session dictionary.'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class SessionException(exceptions.Exception) |
|
Raised if |
|
Methods defined here:
- __init__(self, *args)
Data and non-method functions defined here:
- __doc__ = 'Raised if '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __str__(...)
|
class SessionExpired(SessionException) |
|
Raised if session is expired. |
|
- Method resolution order:
- SessionExpired
- SessionException
- exceptions.Exception
Methods defined here:
- __init__(self, timestamp, session_data)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Raised if session is expired.'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class SessionHijacked(SessionException) |
|
Raised if hijacking of session was detected. |
|
- Method resolution order:
- SessionHijacked
- SessionException
- exceptions.Exception
Methods defined here:
- __init__(self, failed_vars)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Raised if hijacking of session was detected.'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class WebSession |
|
The session class which handles storing and retrieving of session data
in a dictionary-like sessiondict object. |
|
Methods defined here:
- __init__(self, dictobj={}, expireDeactivate=0, expireRemove=0, crossCheckVars=None, maxSessionCount=None)
- dictobj
has to be a instance of a dictionary-like object
(e.g. derived from UserDict or shelve)
expireDeactivate
amount of time (secs) after which a session
expires and a SessionExpired exception is
raised which contains the session data.
expireRemove
Amount of time (secs) after which a session
expires and the session data is silently deleted.
A KeyError exception is raised in this case if
the application trys to access the session ID again.
crossCheckVars
List of keys of variables cross-checked for each
retrieval of session data in retrieveSession()
maxSessionCount
Maximum number of valid sessions. This affects
behaviour of retrieveSession() which raises.
None means unlimited number of sessions.
- _crosscheckSessionEnv(self, stored_env, current_env)
- Returns a list of keys of items which differ in
stored_env and current_env.
- _generateCrosscheckEnv(self, current_env)
- Generate a dictionary of env vars for session cross-checking
- _generateSessionID(self, maxtry=1)
- Generate a new random and unique session id string
- cleanUp(self)
- Search for expired session entries and delete them.
Returns integer counter of deleted sessions as result.
- close(self)
- Call close() if self.sessiondict has .close() method
- deleteSession(self, session_id)
- Delete session_data referenced by session_id.
- newSession(self, env={})
- Store session data under session id
- retrieveSession(self, session_id, env={})
- Retrieve session data
- storeSession(self, session_id, session_data)
- Store session_data under session_id.
- sync(self)
- Call sync if self.sessiondict has .sync() method
Data and non-method functions defined here:
- __doc__ = '\n The session class which handles storing and r...ata\n in a dictionary-like sessiondict object.\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.session'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
| |