simvx.editor.script_ops

Script management operations mixin for State.

Module Contents

Classes

ScriptOps

Mixin providing script attach/detach/create/save operations.

Data

log

API

simvx.editor.script_ops.log

‘getLogger(…)’

class simvx.editor.script_ops.ScriptOps[source]

Mixin providing script attach/detach/create/save operations.

Methods in this class are designed to be mixed into State, which provides the workspace, signals, and delegating properties they depend on.

set_script_text(text: str)[source]

Set the code viewport text and sync it to the selected node’s script.

attach_script(node: simvx.core.Node, path: str, class_name: str = '')[source]

Attach a file-based script to node.

Args: node: The node to attach the script to. path: File path (relative to project root). class_name: The Node subclass name defined in the script. If provided, node.script is set to "path::ClassName".

detach_script(node: simvx.core.Node)[source]

Detach the file-based script from node.

create_script(node: simvx.core.Node, template_name: str, class_name: str, rel_path: str) str | None[source]

Create a new script file from a template and attach it to node.