webstation-broker
DeveloperPython reference

saves

Save data in and out of the emulator's save directories.

Save data in and out of the emulator's save directories.

Activate restores a zip archive into the emulator's save directories; exit zips every save file modified since launch.

attributelog
= logging.getLogger(__name__)
attributeSAVE_FILE_MAX_BYTES
= int(os.environ.get('SAVE_FILE_MAX_BYTES', str(256 * 1024 * 1024)))

Env-tunable guard against runaway dumps, from SAVE_FILE_MAX_BYTES (default 256 MiB).

attributeMANIFEST_NAME
= '.broker-manifest.json'

Index the broker adds to a dump archive, labelling each member for the parent.

_iter_save_files skips it by name if it ever lands in a save tree, and a restore tells the broker's own index from real save data by it.

attributeMANIFEST_VERSION
= 1

Schema version of the archive manifest, for a parent reading old archives.

attributeIMPORT_PREFIX
= '.import/'

Archive prefix that marks a member as a declared import rather than a restored dump.

Every v1 member starts with a save subtree name, and none is .import, so no dump can carry one. A member under it is placed by the emulator's own import rules, not by path.

attributeMANIFEST_MAX_BYTES
= 1024 * 1024

Largest manifest a restore will parse, and only when the archive holds imports.

A v1 dump listing ten thousand files can pass this, which is why a v1-only archive never has its manifest parsed at all.

attributeZIP_READ_ERRORStuple[type[Exception], ...]
= (OSError, ValueError, RuntimeError, NotImplementedError, EOFError, zlib.error, lzma.LZMAError, zipfile.BadZipFile)

What reading a zip member's data can raise, under every compression method zipfile supports.

attributeV1Problem
= Literal['escapes', 'names_subtree', 'outside', 'symlink', 'unreadable', 'scratch', 'duplicate', 'collides', 'too_long', 'unwritable']

Why a v1 member was refused, so a v2 caller can fold it into a refusal code.