spyder.api.shellconnect.mixins#

Mixins for plugins/widgets that are connected to the IPython console.

Classes

ShellConnectMixin()

Mixin to connect any widget or object to the shell widgets in the IPython console.

ShellConnectPluginMixin()

Mixin to connect a plugin composed of stacked widgets to the shell widgets in the IPython console.

ShellConnectWidgetForStackMixin()

Mixin for widgets that will be added to the stacked widget part of ShellConnectMainWidget.

class spyder.api.shellconnect.mixins.ShellConnectMixin[source]#

Bases: object

Mixin to connect any widget or object to the shell widgets in the IPython console.

register_ipythonconsole(ipyconsole)[source]#

Register signals from the console.

unregister_ipythonconsole(ipyconsole)[source]#

Unregister signals from the console.

set_shellwidget(shellwidget)[source]#

Update the current shellwidget.

add_shellwidget(shellwidget)[source]#

Add a new shellwidget to be registered.

remove_shellwidget(shellwidget)[source]#

Remove a registered shellwidget.

add_errored_shellwidget(shellwidget)[source]#

Register a new shellwidget whose kernel failed to start.

class spyder.api.shellconnect.mixins.ShellConnectWidgetForStackMixin[source]#

Bases: object

Mixin for widgets that will be added to the stacked widget part of ShellConnectMainWidget.

sig_show_empty_message_requested#

Signal to request that the empty message will be shown/hidden.

Parameters:

show_empty_message (bool) – Whether show the empty message or this widget must be shown.

class spyder.api.shellconnect.mixins.ShellConnectPluginMixin[source]#

Bases: ShellConnectMixin

Mixin to connect a plugin composed of stacked widgets to the shell widgets in the IPython console.

It is assumed that self.get_widget() returns an instance of ShellConnectMainWidget.

on_ipython_console_available()[source]#

Connect to the IPython console.

on_ipython_console_teardown()[source]#

Disconnect from the IPython console.

set_shellwidget(shellwidget)[source]#

Update the current shellwidget.

Parameters:

shellwidget (spyder.plugins.ipyconsole.widgets.shell.ShellWidget) – The shell widget.

add_shellwidget(shellwidget)[source]#

Add a new shellwidget to be registered.

This function registers a new widget to display content that comes from shellwidget.

Parameters:

shellwidget (spyder.plugins.ipyconsole.widgets.shell.ShellWidget) – The shell widget.

remove_shellwidget(shellwidget)[source]#

Remove a registered shellwidget.

Parameters:

shellwidget (spyder.plugins.ipyconsole.widgets.shell.ShellWidget) – The shell widget.

add_errored_shellwidget(shellwidget)[source]#

Add a new shellwidget whose kernel failed to start.

Parameters:

shellwidget (spyder.plugins.ipyconsole.widgets.shell.ShellWidget) – The shell widget.

current_widget()[source]#

Return the current widget displayed at the moment.

Returns:

current_widget – The widget displayed in the current tab.

Return type:

QWidget

get_widget_for_shellwidget(shellwidget)[source]#

Return the widget registered with the given shellwidget.

Parameters:

shellwidget (spyder.plugins.ipyconsole.widgets.shell.ShellWidget) – The shell widget.

Returns:

current_widget – The widget corresponding to the shellwidget, or None if not found.

Return type:

QWidget