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¶
- simvx.core.process_node.log¶
‘getLogger(…)’
- class simvx.core.process_node.ProcessNode(command: str = '', *, use_pty: bool = False, env: dict[str, str] | None = None, **kwargs)¶
Bases:
simvx.core.engine.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(…)’
- stdout_data¶
‘Signal(…)’
- stderr_data¶
‘Signal(…)’
- process_exited¶
‘Signal(…)’
- ready()¶
- start(command: str | None = None)¶
Launch the subprocess. Replaces any already-running process.
- resize(cols: int, rows: int)¶
Set the PTY terminal size. Only works in PTY mode.
- stop()¶
Terminate the subprocess, escalating to kill if needed.
- write(data: str)¶
Write data to the subprocess stdin (or PTY master).
- process(dt: float)¶
- exit_tree()¶
- property running: bool¶
- property exit_code: int | None¶
- 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) 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)¶
- destroy()¶
- queue_free¶
None
- 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]¶
- get_settings¶
None
- __repr__()¶