Documentation
savestate.open(...)
- filename: str - The name of the savestate. Will have the '.savestate' file extension added to it if it doesn't have it.
- flag: Literal["r", "w", "c", "n"] - Specifies how the savestate should be opened.
- "r" = Open existing savestate for reading only (default).
- "w" = Open existing savestate for reading and writing.
- "c" = Open savestate for reading and writing, creating it if it does not exist.
- "n" = Always create a new, empty savestate, open for reading and writing.
- verify_checksum: bool - Verify that the checksum for a key and value pair is correct on every
__getitem__
call
- compact: bool - Indicate whether to compact the savestate before closing it. No effect in read only mode.
- dbm_mode: bool - Operate in dbm mode. This is faster, but only allows strings for keys and values.
'Read-Only' mode
savestate[key]
key in savestate
len(savestate)
iter(savestate)
reversed(savestate)
str(savestate)
repr(savestate)
savestate.filepath
savestate.filename
savestate.isopen
savestate.keys()
savestate.values()
savestate.items()
savestate.get(key: Any, default: Any = None)
savestate.close()
'Read-Write', 'Create' and 'New' modes
- Extend read-only mode with these methods
savestate[key] = value
del savestate[key]
savestate.pop(key: Any, default: Any = None)
savestate.popitem()
savestate.clear()
savestate.setdefault(key: Any, default: Any = None)
savestate.update(other: Mapping[Any, Any], **kwargs: Any)
savestate.copy(new_filename: str)
savestate.sync()
savestate.compact()
savestate.close(compact: bool = False)