widgets.julia_repl_widget

Class for a custom RichJupyterWidget to use as julia REPL.

author:
  1. Marin (KTH)
date:

22.5.2018

Module Contents

class widgets.julia_repl_widget.CustomQtKernelManager[source]

Bases: qtconsole.manager.QtKernelManager

A QtKernelManager with a custom restarter, and a means to override the –project argument.

kernel_left_dead[source]
project_path[source]
kernel_spec[source]
override_project_arg(self)[source]
start_restarter(self)[source]

Start a restarter with custom time to dead and restart limit.

_handle_kernel_left_dead(self)[source]
class widgets.julia_repl_widget.JuliaREPLWidget(toolbox)[source]

Bases: qtconsole.rich_jupyter_widget.RichJupyterWidget

Class for a custom RichJupyterWidget.

toolbox

QMainWindow instance

Type:ToolboxUI
execution_finished_signal[source]
julia_kernel_name(self)[source]

Returns the name of the julia kernel specification, according to the selected julia interpreter in settings. Returns None if julia version cannot be determined.

start_jupyter_kernel(self)[source]

Start a Julia Jupyter kernel if available.

Returns:True if the kernel is started, or in process of being started (installing/reconfiguring IJulia) False if the kernel cannot be started and the user chooses not to install/reconfigure IJulia
start_available_jupyter_kernel(self)[source]

Start a Jupyter kernel which is available (from the attribute kernel_name)

Returns:True if the kernel is started, or in process of being started (reconfiguring IJulia) False if the kernel cannot be started and the user chooses not to reconfigure IJulia
check_ijulia(self)[source]

Check if IJulia is installed, returns True, False, or None if unable to determine.

handle_repl_failed_to_start(self)[source]

Prompt user to install IJulia if missing, or rebuild it otherwise.

Returns:Boolean value depending on whether or not the problem is being handled.
restart_jupyter_kernel(self)[source]

Restart the julia jupyter kernel if it’s already started. Otherwise, or if the julia version has changed in settings, start a new jupyter kernel.

setup_client(self)[source]
_handle_kernel_restarted(self, died=True)[source]

Called when the kernel is restarted, i.e., when time to dead has elapsed.

_handle_kernel_left_dead(self)[source]

Called when the kernel is finally declared dead, i.e., the restart limit has been reached.

handle_ijulia_installation_finished(self, ret)[source]

Run when IJulia installation process finishes

handle_ijulia_rebuild_finished(self, ret)[source]

Run when IJulia rebuild process finishes

check_ijulia_process(self, ret)[source]

Check whether or not the IJulia process finished successfully

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

Handle status message. If we have a command in line and the kernel reports status ‘idle’, execute that command.

_handle_error(self, msg)[source]

Handle error messages.

execute_instance(self, command)[source]

Try and start the jupyter kernel. Execute command immediately if kernel is idle. If not, it will be executed as soon as the kernel becomes idle (see _handle_status method).

terminate_process(self)[source]

Send interrupt signal to kernel.

shutdown_jupyter_kernel(self)[source]

Shut down the jupyter kernel.

_context_menu_make(self, pos)[source]

Reimplemented to add an action for (re)start REPL action.

enterEvent(self, event)[source]

Set busy cursor during REPL (re)starts.

dragEnterEvent(self, e)[source]

Don’t accept drops from Add Item Toolbar.

copy_input(self)[source]

Copy only input.