Module for functionality to persistently store state.
MissingState[source]¶Bases: exceptions.Exception
Raised when the file or class storing global state is missing.
load(stateCls=None)[source]¶Given a State, try to unpickle it’s statefile.
| Parameters: | stateCls (string) – An instance of State. If
not given, try loading from _statefile if that file exists. |
|---|---|
| Return type: | None or State |
State(config=None, **kwargs)[source]¶Bases: twisted.spread.jelly.Jellyable
Pickled, jellied storage container for persistent state.
Create a persistent state storage mechanism.
Serialisation of certain classes in BridgeDB doesn’t work. Classes and modules which are known to be unjelliable/unpicklable so far are:
- bridgedb.Dist
- bridgedb.Bridges, and all “splitter” and “ring” classes contained within
| Property statefile: | |
|---|---|
The filename to retrieve a pickled, jellied
State instance from. (default:
bridgedb.persistent.State._statefile) |
|
statefile¶Filename property of a persisent.State.