Session
- class compas_session.session.Session(*, name, **kwargs)
Bases:
object
Class representing a data session that can be identified by its name.
The class is implemented such that each named instance is a singleton. This means that during the lifetime of a program only one instance with a specific can exist, and that all sessions created with the same name, refer to the same session object instance.
- Parameters:
- namestr
The name of the unique object instance.
- basedirstr or Path-like, optional
A “working” directory that serves as the root for storing (temporary) session data.
- Raises:
- SessionError
If no name is provided.
Methods
Dump the data of the current session into a file.
Return the value for key if key is in the session, else return default or None.
Replace the session data with the data of a session stored in a file.
Record the current state of the session into session history.
Move one step forward in recorded session history.
Reset session history.
Insert key in the session, and assign value to it.
Return the value of key in the session.
Move one step backward in recorded session history.