spyder.api.shellconnect.main_widget#

Main widget to use in plugins that show content that comes from the IPython console, such as the Variable Explorer or Plots.

Classes

ShellConnectMainWidget(*args[, set_layout])

Main widget to use in a plugin that shows console-specific content.

class spyder.api.shellconnect.main_widget.ShellConnectMainWidget(*args, set_layout=True, **kwargs)[source]#

Bases: PluginMainWidget

Main widget to use in a plugin that shows console-specific content.

Notes

  • This is composed of a QStackedWidget to stack widgets associated to each shell widget in the console and only show one of them at a time.

  • The current widget in the stack will display the content associated to the console with focus.

current_widget()[source]#

Return the current widget in the stack.

Returns:

The current widget.

Return type:

QWidget

get_focus_widget()[source]#

Get the widget to give focus to.

Returns:

QWidget to give focus to.

Return type:

QWidget

Notes

This is applied when the plugin’s dockwidget is raised to the top.

update_style()[source]#

Update stylesheet and style of the widget.

This method will be called recursively on all widgets on theme change.

count()[source]#

Return the number of widgets in the stack.

Returns:

The number of widgets in the stack.

Return type:

int

get_widget_for_shellwidget(shellwidget)[source]#

return widget corresponding to shellwidget.

add_shellwidget(shellwidget)[source]#

Create a new widget in the stack and associate it to shellwidget.

remove_shellwidget(shellwidget)[source]#

Remove widget associated to shellwidget.

set_shellwidget(shellwidget)[source]#

Set widget associated with shellwidget as the current widget.

add_errored_shellwidget(shellwidget)[source]#

Create a new _ErroredMessageWidget in the stack and associate it to shellwidget.

This is necessary to show a meaningful message when switching to consoles with dead kernels.

create_new_widget(shellwidget)[source]#

Create a widget to communicate with shellwidget.

close_widget(widget)[source]#

Close the widget.

switch_widget(widget, old_widget)[source]#

Switch the current widget.

refresh()[source]#

Refresh widgets.

is_current_widget_error_message()[source]#

Check if the current widget is showing an error message.

switch_empty_message(value: bool)[source]#

Switch between the empty message widget or the one with content.