Plugins
Taurus can be extended by third-party modules in various ways. The TEP13 prescribes some generic rules in order to unify the plugins support by using entry-point APIs.
The following subsections describe each entry-point-based pluggable interface currently supported by Taurus, according to TEP13.
CLI subcommands
Description: register subcommands for the
taurusCLI command. Seetaurus.cliGroup:
taurus.cli.subcommandsExpected API:
click.CommandEntry point name convention: None, the name is ignored. Suggestion: use the subcommand name
Loading pattern: extension (loaded when invoking the taurus command)
Enabling pattern: installation
Examples:
taurusself-registers all its subcommands (seesetup.py)
Schemes
Description: new schemes in
taurus.coreto support other sources of data.Group:
taurus.core.schemesExpected API: python module implementing a Taurus scheme. It should at least provide a
taurus.core.taurusfactory.TaurusFactoryspecialization. See more details in Models and schemesEntry point name convention: the name must match the module name. For example:
h5file = h5fileLoading pattern: Driver
Enabling pattern: installation
Examples: taurus_tangoarchiving registers itself as a scheme
Formatters
Description: adding formatter objects for taurus widgets, as used by
taurus.qt.qtgui.base.TaurusBaseComponent.displayValue()Group:
taurus.qt.formattersExpected API: a formatter accepted by
taurus.qt.qtgui.TaurusBaseComponent.setFormat()Entry point name convention: A short descriptive string of the formatter. It may be used by the UI when offering the user to select formatters.
Loading pattern: installation
Enabling pattern: Explicit (e.g. via a selection dialog when calling
taurus.qt.qtgui.TaurusBaseWidget.onSetFormatter())Examples:
taurusself-registers several formatters (seesetup.py)
Model chooser selectors
Description: Adding widgets to be used by
taurus.qt.qtgui.panel.TaurusModelSelectorfor supporting models from other schemesGroup:
taurus.model_selector.itemsExpected API:
taurus.qt.qtgui.panel.TaurusModelSelectorItemEntry point name convention: the name should be a short description of the scheme or type of models supported by this item (e.g.
TangoArchiving = ...). It is used as a tab title intaurus.qt.qtgui.panel.TaurusModelSelectorLoading pattern: Extension
Enabling pattern: installation (but it may be changed in the future to a explicit or self-enabled pattern)
Examples: taurus_tangoarchiving registers
taurus_tangoarchiving.widget.tangoarchivingmodelchooser.TangoArchivingModelSelectorItemas a model selector item
Plot widget alternatives
Description: alternative implementations of TaurusPlot.
Group:
taurus.plot.altsExpected API: to be formally defined with an Abstract Base Class. For now, informally, the API is defined by what is used in
taurus.cli.alt.plot_cmd(): at minimum, aQWidgetthat has asetModel()that accepts a sequence of attribute names.Entry point name convention: a short descriptive identifier of the implementation (e.g.
"tpg", …). The name is used in the UI for user selection of the implementation.Loading pattern: Extension
Enabling pattern: explicit
Examples: taurus_pyqtgraph registers
taurus_pyqtgraph.TaurusPlotas a plot alternative
Trend widget alternatives
Description: alternative implementations of TaurusTrend
Group:
taurus.trend.altsExpected API:to be formally defined with an Abstract Base Class. For now, informally, the API is defined by what is used in
taurus.cli.alt.trend_cmd(): at minimum, aQWidgetthat has asetModel()that accepts a sequence of attribute names.Entry point name convention: a short descriptive identifier of the implementation (e.g.
"tpg", …). The name is used in the UI for user selection of the implementation.Loading pattern: Extension
Enabling pattern: explicit
Examples: taurus_pyqtgraph registers
taurus_pyqtgraph.TaurusTrendas a trend alternative
Image widget alternatives
Description: alternative implementations of TaurusImage
Group:
taurus.image.altsExpected API: to be formally defined with an Abstract Base Class. For now, informally, the API is defined by what is used in
taurus.cli.alt.image_cmd(): at minimum, aQWidgetthat has asetModel()that accepts an attribute name. At this moment, the widget creator needs to accept thewintitlekeyword argument (it may change when the API is formalized)Entry point name convention: a short descriptive identifier of the implementation (e.g.
"plotpy","tpg", …). The name is used in the UI for user selection of the implementation.Loading pattern: Extension
Enabling pattern: explicit
Examples:
taurusself-registers itstaurus.qt.qtgui.extra_plotpy.TaurusImageDialogas an image widget alternative (seesetup.py)
Trend2D widget alternatives
Description: alternative implementations of TaurusTrend2D
Group:
taurus.trend2d.altsExpected API: to be formally defined with an Abstract Base Class. For now, informally, the API is defined by what is used in
taurus.cli.alt.trend2d_cmd(): at minimum, aQWidgetthat has asetModel()that accepts an attribute name. At this moment, the widget creator needs to accept the following keyword arguments:stackMode,wintitle,buffersize. (it may change when the API is formalized)Entry point name convention: a short descriptive identifier of the implementation (e.g.
"plotpy","tpg", …). The name is used in the UI for user selection of the implementation.Loading pattern: Extension
Enabling pattern: explicit
Examples:
taurusself-registers itstaurus.qt.qtgui.extra_plotpy.TaurusTrend2DDialogas trend2d widget alternative (seesetup.py)
Form factories
Description: factories for custom “taurus value” widgets to be used in taurus forms. See
taurus.qt.qtgui.panel.TaurusForm.setItemFactories()Group:
taurus.form.item_factoriesExpected API: a factory function that accepts a model name as its first argument and which returns either a
taurus.qt.qtgui.panel.TaurusValuetype object (orNone)Entry point name convention:
Loading pattern: extension
Enabling pattern: installation, but allowing explicit (de)selection based on
taurus.core.util.plugin.selectEntryPoints().Examples: sardana registers
sardana.taurus.qt.qtgui.extra_pool.formitemfactory.pool_item_factory()to provide custom widgets for sardana elements in taurus forms.
qtgui submodules
Note
This entry point is for internal use only (to be used for backwards compatibility when “outsourcing” submodules).
Description: adding submodules to
taurus.qt.qtgui.Group:
taurus.qt.qtguiExpected API: python module (typically exposing
QWidgetclasses)Entry point name convention: the name must match the module name
Loading pattern: Extension (for performance, we use a
taurus.core.util.lazymodule.LazyModuleto delay the actual import of the module until one of its members is actually used).Enabling pattern: installation
Examples: taurus_pyqtgraph registers itself to be exported as
taurus.qt.qtgui.tpg