LazyLoadSession
- class compas_session.lazyload.LazyLoadSession(*, name, basedir=None, scene=None, settings=None, depth=None, delete_existing=False)
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
Clear session history.
Create all directories.
Remove all directories.
Dump the data of the current session into a session directory.
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 directory.
Record the current state of the session into session history.
Move one step forward in recorded 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.