simvx.editor.live_file_ops¶
Live Python file operations mixin for State.
Module Contents¶
Classes¶
Mixin for opening Python scene files and working with live Node objects. |
|
Polls file mtimes to detect external modifications. |
Data¶
API¶
- simvx.editor.live_file_ops.log¶
‘getLogger(…)’
- class simvx.editor.live_file_ops.LiveFileOps[source]¶
Mixin for opening Python scene files and working with live Node objects.
Replaces JSON-based scene loading with a workflow where the editor imports Python files, identifies Node subclasses, instantiates them, and manipulates live objects. Properties are read from instances via
get_properties().- open_file(path: str | pathlib.Path) None[source]¶
Open a Python file, import it, and instantiate its primary Node class.
- instantiate_class(cls: type) simvx.core.Node | None[source]¶
Safely instantiate a Node subclass. Returns None on error.
- classify_file(module: types.ModuleType, file_path: str) str[source]¶
Classify a Python file. Returns ‘main’, ‘scene’, or ‘node’.
- class simvx.editor.live_file_ops.FileWatcher[source]¶
Polls file mtimes to detect external modifications.
Usage::
watcher = FileWatcher() watcher.watch("/path/to/player.py") # Periodically: changed = watcher.check() # returns list of changed pathsInitialization
- watch_directory(directory: str | pathlib.Path, suffix: str = '.py') None[source]¶
Watch all files with given suffix in a directory tree.