spyder.api.shellconnect.mixins#
Mixins for plugins/widgets that are connected to the IPython console.
Classes
Mixin to connect any widget or object to an IPython Console shell widget. |
|
Mixin to connect a plugin composed of stacked widgets to the shell widgets in the IPython console. |
|
Mixin for widgets added to a stack of those connected to different shells. |
- class spyder.api.shellconnect.mixins.ShellConnectMixin[source]#
Bases:
objectMixin to connect any widget or object to an IPython Console shell widget.
- register_ipythonconsole(ipythonconsole: spyder.plugins.ipythonconsole.plugin.IPythonConsole) None[source]#
Connect this object to the relevant signals of the IPython Console.
- Parameters:
ipythonconsole (spyder.plugins.ipythonconsole.plugin.IPythonConsole) – The IPython Console to connect this object to the signals of.
- Return type:
None
- unregister_ipythonconsole(ipythonconsole: spyder.plugins.ipythonconsole.plugin.IPythonConsole) None[source]#
Disconnect this object from the relevant signals of the IPython Console.
- Parameters:
ipythonconsole (spyder.plugins.ipythonconsole.plugin.IPythonConsole) – The IPython Console to disconnect this object from the signals of.
- Return type:
None
- set_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Set as active the stack widget associated to the given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget that corresponds to the stacked widget to set as currently active.
- Return type:
None
- add_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Create a new object associated with the given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to associate the new widget to.
- Return type:
None
- remove_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Remove the object associated to a given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to remove the associated object of.
- Return type:
None
- add_errored_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Register an error widget if the shell widget’s kernel failed to start.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to associate with a new error widget.
- Return type:
None
- class spyder.api.shellconnect.mixins.ShellConnectWidgetForStackMixin[source]#
Bases:
objectMixin for widgets added to a stack of those connected to different shells.
Used for the stacked widgets of
ShellConnectMainWidget.
- class spyder.api.shellconnect.mixins.ShellConnectPluginMixin[source]#
Bases:
ShellConnectMixinMixin 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() None[source]#
Connect this object to the relevant signals of the IPython Console.
- Return type:
None
- on_ipython_console_teardown() None[source]#
Disconnect this object from the relevant signals of the IPython Console.
- Return type:
None
- set_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Set as active the stack widget associated to the given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget that corresponds to the stacked widget to set as currently active.
- Return type:
None
- add_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Create a new widget in the stack associated to a given shell widget.
This method registers a new widget to display the content that is associated with the given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to associate the new widget to.
- Return type:
None
- remove_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Remove the widget associated to a given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to remove the associated widget of.
- Return type:
None
- add_errored_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) None[source]#
Add an error widget for a shell widget whose kernel failed to start.
This is necessary to show a meaningful message when switching to consoles with dead kernels.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to associate with a new error widget.
- Return type:
None
- current_widget() QWidget[source]#
Get the widget corresponding to the currently active console tab.
- Returns:
The current widget in the stack, associated with the active
ShellWidget(i.e. IPython Console tab).- Return type:
- get_widget_for_shellwidget(shellwidget: spyder.plugins.ipythonconsole.widgets.ShellWidget) QWidget[source]#
Retrieve the stacked widget corresponding to the given shell widget.
- Parameters:
shellwidget (spyder.plugins.ipythonconsole.widgets.ShellWidget) – The shell widget to return the associated widget of.
- Returns:
The widget in the stack associated with
shellwidget, orNoneif not found.- Return type:
QWidget | None