spyder.api.plugin_registration.mixins#
Spyder API plugin registration mixins.
Deprecated since version 6.2: This module will be moved to a private spyder.api._mixins module
and become a deprecated alias, raising a DeprecationWarning,
that will be removed in Spyder 7.0.
It is a private implementation detail of the plugin decorators in
spyder.api.plugin_registration.decorators, and wasn’t designed
or intended to be used directly by external code. Plugins access its
functionality through the SpyderPluginV2
class instead.
Classes
Mixin to receive and respond to changes in Spyder plugin availability. |
- class spyder.api.plugin_registration.mixins.SpyderPluginObserver[source]#
Bases:
objectMixin to receive and respond to changes in Spyder plugin availability.
This mixin enables a class to receive notifications when a plugin is available, by registering methods using the
on_plugin_available()decorator. When any of the requested plugins is ready, the corresponding registered method is called.Normally inherited and initialized automatically through
SpyderPluginV2rather than used directly.Caution
This mixin will only operate over the plugins listed under the
REQUIRESorOPTIONALclass constants of the class inheriting the mixin.- __init__() None[source]#
Set up the plugin listeners for any decorated methods of the class.
Called automatically by
SpyderPluginV2.__init__().- Return type:
None
- Raises:
SpyderAPIError – If trying to watch a plugin that is not listed in the plugin class’
REQUIRESorOPTIONALclass constants.