spinetoolbox.widgets.spine_console_widget

Class for a custom RichJupyterWidget that can run Tool instances.

authors:
  1. Marin (KTH), P. Savolainen (VTT)
date:

22.10.2019

Module Contents

Classes

SpineConsoleWidget Base class for all embedded console widgets that can run tool instances.
class spinetoolbox.widgets.spine_console_widget.SpineConsoleWidget(toolbox, name)[source]

Bases: qtconsole.rich_jupyter_widget.RichJupyterWidget

Base class for all embedded console widgets that can run tool instances.

Parameters:
  • toolbox (ToolboxUI) – QMainWindow instance
  • name (str) – Console name, e.g. ‘Python Console’
ready_to_execute[source]
execution_failed[source]
name(self)[source]

Returns console name.

start_menu_action(self, checked=False)[source]

Starts chosen Python/Julia kernel if available and not already running. Context menu start action handler.

restart_menu_action(self, checked=False)[source]

Restarts chosen Python/Julia kernel. Starts a new kernel if it is not running or if chosen kernel has been changed in Settings. Context menu restart action handler.

wake_up(self, k_name=None)[source]

Wakes up the console in preparation for execution. Either ready_to_execute or execution_failed signal must be emitted as a consequence of calling this method.

start_kernel(self, k_name, k_path)[source]

Starts a kernel manager and kernel client and attaches the client to Julia or Python Console.

Parameters:
  • k_name (str) – Kernel name
  • k_path (str) – Directory where the the kernel specs are located
shutdown_kernel(self)[source]

Shut down Julia/Python kernel.

dragEnterEvent(self, e)[source]

Don’t accept project item drops.

_handle_execute_reply(self, msg)[source]
_handle_status(self, msg)[source]

Handles status message.

_handle_error(self, msg)[source]

Handles error messages.

enterEvent(self, event)[source]

Sets busy cursor during console (re)starts.

_is_complete(self, source, interactive)[source]

See base class.

_context_menu_make(self, pos)[source]

Reimplemented to add actions to console context-menus.

copy_input(self)[source]

Copies only input.

_setup_client(self)[source]

Sets up client.

connect_to_kernel(self, kernel_name, connection_file)[source]

Connects to an existing kernel. Used when Spine Engine is managing the kernel for project execution.

Parameters:connection_file (str) – Path to the connection file of the kernel
interrupt(self)[source]

[TODO: Remove?] Sends interrupt signal to kernel.