File: plugins.rst

package info (click to toggle)
taurus 5.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 100,792 kB
  • sloc: python: 51,356; sh: 67; makefile: 12
file content (186 lines) | stat: -rw-r--r-- 8,373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.. _plugins:

==============
Taurus 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 ``taurus`` CLI command. See :mod:`taurus.cli`
- Group: ``taurus.cli.subcommands``
- Expected API: :class:`click.Command`
- Entry 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: :mod:`taurus` self-registers all its subcommands (see ``setup.py``)

Schemes
-----------------------------------


- Description: new schemes in taurus.core to support other sources of data.
- Group: ``taurus.core.schemes``
- Expected API: python module implementing a Taurus scheme. It should at least
  provide a :class:`taurus.core.taurusfactory.TaurusFactory` specialization.
  See more details in the `Taurus Core Tutorial`_
- Entry point name convention: the name must match the module name.
  For example: ``h5file = h5file``
- Loading pattern: Driver
- Enabling pattern: installation
- Examples: taurus_tangoarchiving_ registers itself as a scheme

Formatters
-----------------------------------

- Description: adding formatter objects for taurus widgets, as used by
  :meth:`taurus.qt.qtgui.base.TaurusBaseComponent.displayValue`
- Group: ``taurus.qt.formatters``
- Expected API: a formatter accepted by :meth:`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
  :meth:`taurus.qt.qtgui.TaurusBaseWidget.onSetFormatter`)
- Examples: :mod:`taurus` self-registers several formatters (see ``setup.py``)

Model Chooser Selectors
-----------------------------------

- Description: Adding widgets to be used by :class:`taurus.qt.qtgui.panel.TaurusModelSelector`
  for supporting models from other schemes
- Group: ``taurus.model_selector.items``
- Expected API: :class:`taurus.qt.qtgui.panel.TaurusModelSelectorItem`
- Entry 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 in :class:`taurus.qt.qtgui.panel.TaurusModelSelector`
- Loading pattern: Extension
- Enabling pattern: installation (but it may be changed in the future to a
  explicit or self-enabled pattern)
- Examples: taurus_tangoarchiving_ registers
  :class:`taurus_tangoarchiving.widget.tangoarchivingmodelchooser.TangoArchivingModelSelectorItem`
  as a model selector item

Plot widget Alternatives
-----------------------------------

- Description: alternative implementations of TaurusPlot.
- Group: ``taurus.plot.alts``
- Expected API: *to be formally defined with an Abstract Base Class*. For now,
  informally, the API is defined by what is used in
  :func:`taurus.cli.alt.plot_cmd`:  at minimum, a :class:`QWidget` that has a
  :meth:`setModel` 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 :class:`taurus_tauruspyqtgraph.TaurusPlot`
  as a plot alternative

Trend widget Alternatives
-----------------------------------

- Description: alternative implementations of TaurusTrend
- Group: ``taurus.trend.alts``
- Expected API:*to be formally defined with an Abstract Base Class*. For now,
  informally, the API is defined by what is used in
  :func:`taurus.cli.alt.trend_cmd`:  at minimum, a :class:`QWidget` that has a
  :meth:`setModel` 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 :class:`taurus_tauruspyqtgraph.TaurusTrend`
  as a trend alternative

Image widget Alternatives
-----------------------------------

- Description: alternative implementations of TaurusImage
- Group: ``taurus.image.alts``
- Expected API: *to be formally defined with an Abstract Base Class*. For now,
  informally, the API is defined by what is used in
  :func:`taurus.cli.alt.image_cmd`:  at minimum, a :class:`QWidget` that has a
  :meth:`setModel` that accepts an attribute name. At this moment, the
  widget creator needs to accept the ``wintitle`` keyword argument (it may
  change when the API is formalized)
- Entry point name convention: a short descriptive identifier of the
  implementation (e.g. ``"guiqwt"``, ``"tpg"``, ...). The name is used in the UI
  for user selection of the implementation.
- Loading pattern: Extension
- Enabling pattern: explicit
- Examples: :mod:`taurus` self-registers its
  :class:`taurus.qt.qtgui.extra_guiqwt.TaurusImageDialog` as an image widget
  alternative (see ``setup.py``)

Trend2D widget Alternatives
-----------------------------------

- Description: alternative implementations of TaurusTrend2D
- Group: ``taurus.trend2d.alts``
- Expected API: *to be formally defined with an Abstract Base Class*. For now,
  informally, the API is defined by what is used in
  :func:`taurus.cli.alt.trend2d_cmd`:  at minimum, a :class:`QWidget` that has a
  :meth:`setModel` 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. ``"guiqwt"``, ``"tpg"``, ...). The name is used in the UI
  for user selection of the implementation.
- Loading pattern: Extension
- Enabling pattern: explicit
- Examples: :mod:`taurus` self-registers its
  :class:`taurus.qt.qtgui.extra_guiqwt.TaurusTrend2DDialog` as trend2d widget
  alternative (see ``setup.py``)

Form Factories
-----------------------------------

- Description: factories for custom "taurus value" widgets to be used in taurus
  forms. See :meth:`taurus.qt.qtgui.panel.TaurusForm.setItemFactories`
- Group: ``taurus.form.item_factories``
- Expected API: a factory function that accepts a model name as its first
  argument and which returns either a :class:`taurus.qt.qtgui.panel.TaurusValue`
  type object (or ``None``)
- Entry point name convention:
- Loading pattern: extension
- Enabling pattern: installation, but allowing explicit (de)selection based
  on :func:`taurus.core.util.plugin.selectEntryPoints`.
- Examples: sardana_ registers
  :func:`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 :mod:`taurus.qt.qtgui`.
- Group: ``taurus.qt.qtgui``
- Expected API: python module (typically exposing :class:`QWidget` classes)
- Entry point name convention: the name must match the module name
- Loading pattern: Extension (for performance, we use a
  :class:`taurus.core.util.lazymodule.LazyModule` to 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
  :mod:`taurus.qt.qtgui.tpg`


.. _TEP13: http://www.taurus-scada.org/tep?TEP13.md
.. _`Taurus Core Tutorial`: http://taurus-scada.org/devel/core_tutorial.html
.. _taurus_tangoarchiving: https://gitlab.com/taurus-org/taurus_tangoarchiving
.. _taurus_pyqtgraph: https://gitlab.com/taurus-org/taurus_pyqtgraph
.. _sardana: https://sardana-controls.org/