spyder.api.preferences#

API to create an entry in Spyder Preferences associated to a given plugin.

Classes

PluginConfigPage(plugin, parent)

Widget to expose the options a plugin offers for configuration as an entry in Spyder's Preferences dialog.

SpyderPreferencesTab(parent)

Widget that represents a tab on a preference page.

class spyder.api.preferences.SpyderPreferencesTab(parent: SpyderConfigPage)[source]#

Bases: BaseConfigTab

Widget that represents a tab on a preference page.

All calls to SpyderConfigPage attributes are resolved via delegation.

apply_settings() Set[str | Tuple[str, ...]][source]#

Hook called to manually apply settings that cannot be automatically applied.

Reimplement this if the configuration tab has complex widgets that cannot be created with any of the self.create_* calls.

is_valid() bool[source]#

Return True if the tab contents are valid.

This method can be overriden to perform complex checks.

setLayout(layout)[source]#

Remove default margins by default.

class spyder.api.preferences.PluginConfigPage(plugin, parent)[source]#

Bases: SpyderConfigPage

Widget to expose the options a plugin offers for configuration as an entry in Spyder’s Preferences dialog.

aggregate_sections_partials(opts)[source]#

Aggregate options by sections in order to notify observers.

get_name()[source]#

Return plugin name to use in preferences page title, and message boxes.

Normally you do not have to reimplement it, as soon as the plugin name in preferences page will be the same as the plugin title.

get_icon()[source]#

Return plugin icon to use in preferences page.

Normally you do not have to reimplement it, as soon as the plugin icon in preferences page will be the same as the plugin icon.

setup_page()[source]#

Setup configuration page widget

You should implement this method and set the layout of the preferences page.

layout = QVBoxLayout() layout.addWidget(…) … self.setLayout(layout)

apply_settings() Set[str | Tuple[str, ...]][source]#

Hook called to manually apply settings that cannot be automatically applied.

Reimplement this if the configuration page has complex widgets that cannot be created with any of the self.create_* calls.

This call should return a set containing the configuration options that changed.