ryvencore.Session module¶
- class Session(gui: bool = False)¶
Bases:
ryvencore.Base.BaseThe Session is the top level interface to an editor, it represents a project and manages all project-wide components.
- new_script_created = <ryvencore.Base.Event object>¶
- script_renamed = <ryvencore.Base.Event object>¶
- script_deleted = <ryvencore.Base.Event object>¶
- register_nodes(node_classes: List)¶
Registers a list of Nodes which you then can access in all scripts
- register_node(node_class)¶
Registers a Node which then can be accessed in all scripts
- unregister_node(node_class)¶
Unregisters a Node which will then be removed from the available list. Existing instances won’t be affected.
- all_node_objects() List¶
Returns a list containing all Node objects used in any flow which is useful for advanced project analysis
- create_script(title: Optional[str] = None, create_default_logs=True, data: Optional[dict] = None) ryvencore.Script.Script¶
Creates and returns a new script. If data is provided the title parameter will be ignored.
- rename_script(script: ryvencore.Script.Script, title: str) bool¶
Renames an existing script
- script_title_valid(title: str) bool¶
Checks whether a considered title for a new script is valid (unique) or not
- delete_script(script: ryvencore.Script.Script)¶
Removes an existing script.
- info_messenger()¶
Returns a reference to InfoMsgs to print info data
- load(project: Dict) List[ryvencore.Script.Script]¶
Loads a project and raises an exception if required nodes are missing
- serialize()¶
Returns the project as JSON compatible dict to be saved and loaded again using load()
- data() dict¶
converts the object to a JSON compatible dict for serialization