spinetoolbox.widgets.persistent_console_widget
Contains a widget acting as a console for Julia & Python REPL’s.
Module Contents
Classes
A widget to interact with a persistent process. |
|
Functions
|
- class spinetoolbox.widgets.persistent_console_widget._CustomLineEdit(console)[source]
Bases:
PySide6.QtWidgets.QPlainTextEdit
- class spinetoolbox.widgets.persistent_console_widget.PersistentConsoleWidget(toolbox, key, language, owner=None)[source]
Bases:
PySide6.QtWidgets.QPlainTextEdit
A widget to interact with a persistent process.
- Parameters
toolbox (ToolboxUI) –
key (tuple) – persistent process identifier
language (str) – for syntax highlighting and prompting, etc.
owner (ProjectItemBase, optional) – console owner
- _insert_stdin_text(cursor, text)[source]
Inserts highlighted text.
- Parameters
cursor (QTextCursor) –
text (str) –
- _insert_stdout_text(cursor, text)[source]
Inserts ansi highlighted text.
- Parameters
cursor (QTextCursor) –
text (str) –
- _insert_text_before_prompt(text, with_prompt=False)[source]
Inserts given text before the prompt. Used when adding input and output from external execution.
- Parameters
text (str) –
- set_killed(killed)[source]
Emits the
killed
signal.- Parameters
killed (bool) – if True, may the console rest in peace
- _do_set_killed(killed)[source]
Sets the console as killed or alive.
- Parameters
killed (bool) – if True, may the console rest in peace
- add_stdin(data)[source]
Adds new prompt with data. Used when adding stdin from external execution.
- Parameters
data (str) –
- add_stdout(data)[source]
Adds new line to stdout. Used when adding stdout from external execution.
- Parameters
data (str) –
- add_stderr(data)[source]
Adds new line to stderr. Used when adding stderr from external execution.
- Parameters
data (str) –
- key_press_event(ev)[source]
Handles key press event from line edit.
- Returns
True if handled, False if not.
- create_engine_manager()[source]
Returns a new local or remote spine engine manager or an existing remote spine engine manager. Returns None if connecting to Spine Engine Server fails.
- _autocomplete(text)[source]
Autocompletes current text in the prompt (or output options if multiple matches).
- Parameters
text (str) –
- _interrupt_persistent(_=False)[source]
Sends a task to executor which will interrupt the underlying persistent process.
- _kill_persistent(_=False)[source]
Sends a task to executor which will kill the underlying persistent process.
Appends two more actions: Restart, and Interrupt.
- Parameters
menu (QMenu) – where to append