simvx.core.process_node¶
ProcessNode — Node wrapping subprocess.Popen with non-blocking I/O.
Supports both pipe-based (default) and PTY-based subprocess management. PTY mode is required for interactive terminal applications like bash, nano, vim.
Module Contents¶
Classes¶
Node that manages a subprocess with non-blocking I/O. |
Data¶
API¶
- class simvx.core.process_node.ProcessNode(command: str = '', *, use_pty: bool = False, env: dict[str, str] | None = None, **kwargs)[source]¶
Bases:
simvx.core.node.NodeNode that manages a subprocess with non-blocking I/O.
Emits stdout_data(str) and stderr_data(str) as output arrives, and process_exited(int) when the child terminates. The process is polled each frame in process(dt) with zero-timeout selector calls so the game loop is never blocked.
For interactive terminal applications, set use_pty=True to allocate a pseudo-terminal. In PTY mode, stdout and stderr are merged.
Initialization
- auto_start¶
‘Property(…)’
- command¶
‘Property(…)’
- start(command: str | None = None)[source]¶
Launch the subprocess. Replaces any already-running process.
- property running: bool¶
- property exit_code: int | None¶
- strict_errors: ClassVar[bool]¶
True
- script_error_raised¶
‘Signal(…)’
- classmethod __init_subclass__(**kwargs)¶
- property name: str¶
- property process_mode: simvx.core.descriptors.ProcessMode¶
- reset_error() None¶
- add_child(node: simvx.core.node.Node) simvx.core.node.Node¶
- remove_child(node: simvx.core.node.Node)¶
- reparent(new_parent: simvx.core.node.Node)¶
- get_node(path: str) simvx.core.node.Node¶
- find_child(name: str, recursive: bool = False) simvx.core.node.Node | None¶
- find(node_type: type, recursive: bool = True) simvx.core.node.Node | None¶
- property path: str¶
- add_to_group(group: str)¶
- remove_from_group(group: str)¶
- is_in_group(group: str) bool¶
- enter_tree() None¶
- physics_process(dt: float) None¶
- draw(renderer) None¶
- input_event(event: simvx.core.events.InputEvent) None¶
- input(event: simvx.core.events.TreeInputEvent) None¶
- unhandled_input(event: simvx.core.events.TreeInputEvent) None¶
- start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle¶
- stop_coroutine(gen_or_handle)¶
- clear_children()¶
- destroy()¶
- property app¶
- property tree: simvx.core.scene_tree.SceneTree¶
- get_tree() simvx.core.scene_tree.SceneTree¶
- __getitem__(key: str)¶
- classmethod get_properties() dict[str, simvx.core.descriptors.Property]¶
- __repr__()¶