Project#
A read-only project snapshot from an external process (plupy.Project.open(path, executable)).
path: project directory/package. executable: path to the Plush editor executable, not a Python executable. Calls --project-snapshot and waits up to 60 seconds.
| Project member | Type / result |
|---|---|
generation | int; snapshot generation |
datablocks | tuple[Datablock, ...] |
types | tuple[tuple[str, tuple[Property, ...]], ...]; registered schemas |
of_type(kind) | Tuple of datablocks whose type exactly matches kind |
properties_for(kind) | Tuple of schema properties; empty if missing |
sprite_budget(limit_bytes=4194304) | Tuple of diagnostic dictionaries for sprites exceeding the decoded-byte budget |
Project.from_snapshot(snapshot) | Parse a version-1 project snapshot dictionary |
Datablock fields: id, type, name, path (str); source (str | None); embedded (bool); width, height, decodedBytes (int | None); users, dependencies (tuple[str, ...]). These are copies, not editable DataBlock handles.
Property fields: key, label, kind (str), targetType (str | None). Budget diagnostic keys: checkId, severity, targetId, generation, message.
@dataclass(frozen=True)
class ProjectUsage and examples
Members: generation · datablocks · types · open · from_snapshot · properties_for · of_type · sprite_budget
generation#
generation: intdatablocks#
datablocks: tuple[Datablock, ...]types#
types: tuple[tuple[str, tuple[Property, ...]], ...] = ()open#
open(path, executable)Run the editor's --project-snapshot on a project and parse the result (waits up to 60 seconds). executable is the Plush editor, not a Python executable.
from_snapshot#
from_snapshot(snapshot)Parse a version-1 project snapshot dictionary.
properties_for#
properties_for(kind)The registered schema properties of a datablock kind, or an empty tuple.
of_type#
of_type(kind)The datablocks whose type equals kind.
sprite_budget#
sprite_budget(limit_bytes=4 * 1024 * 1024)Diagnostic dicts (checkId, severity, targetId, generation, message) for sprites whose decoded size exceeds limit_bytes.
Related types#
DataBlock · Datablock · Property
Source#
- __init__.py:32