bec-widgets 0.65.2__py3-none-any.whl → 0.66.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +12 -8
- PKG-INFO +1 -1
- bec_widgets/cli/rpc_wigdet_handler.py +33 -13
- bec_widgets/utils/bec_dispatcher.py +10 -3
- bec_widgets/widgets/dock/dock.py +3 -3
- {bec_widgets-0.65.2.dist-info → bec_widgets-0.66.1.dist-info}/METADATA +1 -1
- {bec_widgets-0.65.2.dist-info → bec_widgets-0.66.1.dist-info}/RECORD +12 -11
- pyproject.toml +1 -1
- tests/unit_tests/test_rpc_widget_handler.py +7 -0
- {bec_widgets-0.65.2.dist-info → bec_widgets-0.66.1.dist-info}/WHEEL +0 -0
- {bec_widgets-0.65.2.dist-info → bec_widgets-0.66.1.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.65.2.dist-info → bec_widgets-0.66.1.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.66.1 (2024-06-20)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix: fixed shutdown for pyside ([`2718bc6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2718bc624731301756df524d0d5beef6cb1c1430))
|
8
|
+
|
9
|
+
## v0.66.0 (2024-06-20)
|
10
|
+
|
11
|
+
### Feature
|
12
|
+
|
13
|
+
* feat(rpc): discover widgets automatically ([`ef25f56`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ef25f5638032f931ceb292540ada618508bb2aed))
|
14
|
+
|
3
15
|
## v0.65.2 (2024-06-20)
|
4
16
|
|
5
17
|
### Fix
|
@@ -151,24 +163,16 @@ This reverts commit abc6caa2d0b6141dfbe1f3d025f78ae14deddcb3 ([`fe04dd8`](https:
|
|
151
163
|
|
152
164
|
* feat: added isort to bw-generate-cli ([`f0391f5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f0391f59c9eb0a51b693fccfe2e399e869d35dda))
|
153
165
|
|
154
|
-
* feat: added entry point for bw-generate-cli ([`1c7f491`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1c7f4912ce5998e666276969bf4af8656d619a91))
|
155
|
-
|
156
|
-
* feat(cli): auto-discover rpc-enabled widgets ([`df1be10`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df1be10057a5e85a3f35bef1c1b27366b6727276))
|
157
|
-
|
158
166
|
### Fix
|
159
167
|
|
160
168
|
* fix: removed BECConnector from rpc client interface ([`6428e38`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6428e38ab94c15a2c904e75cc6404bb6d0394e04))
|
161
169
|
|
162
|
-
* fix: added bec_ipython_client as dependency; needed for jupyter widget ([`006a089`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/006a0894b85cba3b2773737ed6fe3e92c81cdee0))
|
163
|
-
|
164
170
|
### Refactor
|
165
171
|
|
166
172
|
* refactor: minor cleanup ([`3adf6cf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3adf6cfd586355c8b8ce7fdc9722f868e22287c5))
|
167
173
|
|
168
174
|
* refactor: disabled pylint for auto-gen client ([`b15816c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b15816ca9fd3e4ae87cca5fcfe029b4dfca570ca))
|
169
175
|
|
170
|
-
* refactor(isort): added bec_widgets as known first party package ([`9c5a471`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9c5a471234ed2928e4527b079436db2a807c5f6f))
|
171
|
-
|
172
176
|
### Test
|
173
177
|
|
174
178
|
* test: added missing pylint statement to header ([`f662985`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f6629852ebc2b4ee239fa560cc310a5ae2627cf7))
|
PKG-INFO
CHANGED
@@ -1,22 +1,37 @@
|
|
1
1
|
from bec_widgets.utils import BECConnector
|
2
|
-
from bec_widgets.widgets.figure import BECFigure
|
3
|
-
from bec_widgets.widgets.spiral_progress_bar.spiral_progress_bar import SpiralProgressBar
|
4
|
-
from bec_widgets.widgets.text_box.text_box import TextBox
|
5
|
-
from bec_widgets.widgets.website.website import WebsiteWidget
|
6
2
|
|
7
3
|
|
8
4
|
class RPCWidgetHandler:
|
9
5
|
"""Handler class for creating widgets from RPC messages."""
|
10
6
|
|
11
|
-
|
12
|
-
|
13
|
-
"SpiralProgressBar": SpiralProgressBar,
|
14
|
-
"Website": WebsiteWidget,
|
15
|
-
"TextBox": TextBox,
|
16
|
-
}
|
7
|
+
def __init__(self):
|
8
|
+
self._widget_classes = None
|
17
9
|
|
18
|
-
@
|
19
|
-
def
|
10
|
+
@property
|
11
|
+
def widget_classes(self):
|
12
|
+
"""
|
13
|
+
Get the available widget classes.
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
dict: The available widget classes.
|
17
|
+
"""
|
18
|
+
if self._widget_classes is None:
|
19
|
+
self.update_available_widgets()
|
20
|
+
return self._widget_classes
|
21
|
+
|
22
|
+
def update_available_widgets(self):
|
23
|
+
"""
|
24
|
+
Update the available widgets.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
None
|
28
|
+
"""
|
29
|
+
from bec_widgets.utils.plugin_utils import get_rpc_classes
|
30
|
+
|
31
|
+
clss = get_rpc_classes("bec_widgets")
|
32
|
+
self._widget_classes = {cls.__name__: cls for cls in clss["top_level_classes"]}
|
33
|
+
|
34
|
+
def create_widget(self, widget_type, **kwargs) -> BECConnector:
|
20
35
|
"""
|
21
36
|
Create a widget from an RPC message.
|
22
37
|
|
@@ -27,7 +42,12 @@ class RPCWidgetHandler:
|
|
27
42
|
Returns:
|
28
43
|
widget(BECConnector): The created widget.
|
29
44
|
"""
|
30
|
-
|
45
|
+
if self._widget_classes is None:
|
46
|
+
self.update_available_widgets()
|
47
|
+
widget_class = self._widget_classes.get(widget_type)
|
31
48
|
if widget_class:
|
32
49
|
return widget_class(**kwargs)
|
33
50
|
raise ValueError(f"Unknown widget type: {widget_type}")
|
51
|
+
|
52
|
+
|
53
|
+
widget_handler = RPCWidgetHandler()
|
@@ -9,7 +9,7 @@ import redis
|
|
9
9
|
from bec_lib.client import BECClient
|
10
10
|
from bec_lib.redis_connector import MessageObject, RedisConnector
|
11
11
|
from bec_lib.service_config import ServiceConfig
|
12
|
-
from qtpy.QtCore import QCoreApplication, QObject
|
12
|
+
from qtpy.QtCore import PYQT5, PYQT6, PYSIDE2, PYSIDE6, QCoreApplication, QObject
|
13
13
|
from qtpy.QtCore import Signal as pyqtSignal
|
14
14
|
|
15
15
|
if TYPE_CHECKING:
|
@@ -115,9 +115,16 @@ class BECDispatcher:
|
|
115
115
|
def reset_singleton(cls):
|
116
116
|
cls._instance = None
|
117
117
|
cls._initialized = False
|
118
|
-
|
118
|
+
|
119
|
+
if not cls.qapp:
|
120
|
+
return
|
121
|
+
|
122
|
+
# shutdown QCoreApp if it exists
|
123
|
+
if PYQT5 or PYQT6:
|
119
124
|
cls.qapp.exit()
|
120
|
-
|
125
|
+
elif PYSIDE2 or PYSIDE6:
|
126
|
+
cls.qapp.shutdown()
|
127
|
+
cls.qapp = None
|
121
128
|
|
122
129
|
def connect_slot(
|
123
130
|
self, slot: Callable, topics: Union[EndpointInfo, str, list[Union[EndpointInfo, str]]]
|
bec_widgets/widgets/dock/dock.py
CHANGED
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, Literal, Optional
|
|
5
5
|
from pydantic import Field
|
6
6
|
from pyqtgraph.dockarea import Dock
|
7
7
|
|
8
|
-
from bec_widgets.cli.rpc_wigdet_handler import
|
8
|
+
from bec_widgets.cli.rpc_wigdet_handler import widget_handler
|
9
9
|
from bec_widgets.utils import BECConnector, ConnectionConfig, GridLayoutManager
|
10
10
|
|
11
11
|
if TYPE_CHECKING:
|
@@ -149,7 +149,7 @@ class BECDock(BECConnector, Dock):
|
|
149
149
|
Returns:
|
150
150
|
list: The list of eligible widgets.
|
151
151
|
"""
|
152
|
-
return list(
|
152
|
+
return list(widget_handler.widget_classes.keys())
|
153
153
|
|
154
154
|
def add_widget(
|
155
155
|
self,
|
@@ -178,7 +178,7 @@ class BECDock(BECConnector, Dock):
|
|
178
178
|
self.layout_manager.shift_widgets(shift, start_row=row)
|
179
179
|
|
180
180
|
if isinstance(widget, str):
|
181
|
-
widget =
|
181
|
+
widget = widget_handler.create_widget(widget)
|
182
182
|
else:
|
183
183
|
widget = widget
|
184
184
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=RnYDz4zKXjlqltTryprlB1s5vLXxI2-seW-Vb70NNF0,8162
|
3
3
|
.pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=Vh2_soSc85dy9lRU01vmqFhnlnY81lRRHA67ib_xlto,6911
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=u-mGylcSYfdLA6I276ETlul9ZXRitI9ECVKvIBxHY8w,1302
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=6z3-hs4UXP5ysKDuF4Te-9abra68AXuIvGB3ReAukC4,2162
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
|
12
12
|
.gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
|
@@ -21,7 +21,7 @@ bec_widgets/cli/client.py,sha256=GJRzys0DVHQp8X9QxociTrshPm4CvaPtEprxWEpEKCs,564
|
|
21
21
|
bec_widgets/cli/client_utils.py,sha256=D076XKwcukKBKknd11B1UyOcQN_9sN7ZKMVttyCxS9Q,11586
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=Bi8HxHhge1I87vbdYHZUZiZwvbB-OSkLYS5Xfmwiz9M,4922
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
24
|
-
bec_widgets/cli/rpc_wigdet_handler.py,sha256=
|
24
|
+
bec_widgets/cli/rpc_wigdet_handler.py,sha256=1qQOGrM8rozaWLkoxAW8DTVLv_L_DZdZgUMDPy5MOek,1486
|
25
25
|
bec_widgets/cli/server.py,sha256=4sigviIyJgZOgikWHc1X998vWAWayKF6S61oAY_mVDQ,5727
|
26
26
|
bec_widgets/examples/__init__.py,sha256=WWQ0cu7m8sA4Ehy-DWdTIqSISjaHsbxhsNmNrMnhDZU,202
|
27
27
|
bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -32,7 +32,7 @@ bec_widgets/examples/motor_movement/motor_control_compilations.py,sha256=8rpA7a2
|
|
32
32
|
bec_widgets/examples/motor_movement/motor_controller.ui,sha256=83XX6NGILwntoUIghvzWnMuGf80O8khK3SduVKTAEFM,29105
|
33
33
|
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
34
34
|
bec_widgets/utils/bec_connector.py,sha256=RxHJNF7JjtY5pRbTMu2eQTiRXvoyJ53QuTYxHjZba38,5357
|
35
|
-
bec_widgets/utils/bec_dispatcher.py,sha256=
|
35
|
+
bec_widgets/utils/bec_dispatcher.py,sha256=vvHpD_7ZddRmD6mHR5JWU_XEJYxognpmG7CnEWMjaZk,5989
|
36
36
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
37
37
|
bec_widgets/utils/colors.py,sha256=GYSDe0ZxsJSwxvuy-yG2BH17qlf_Sjq8dhDcyp9IhBI,8532
|
38
38
|
bec_widgets/utils/container_utils.py,sha256=m3VUyAYmSWkEwApP9tBvKxPYVtc2kHw4toxIpMryJy4,1495
|
@@ -57,7 +57,7 @@ bec_widgets/widgets/device_inputs/device_combobox/device_combobox.py,sha256=_XL4
|
|
57
57
|
bec_widgets/widgets/device_inputs/device_line_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
58
|
bec_widgets/widgets/device_inputs/device_line_edit/device_line_edit.py,sha256=cvvFg9HS7yN9kn-lWI_Uvj_dq2xlqNhuDi21e73k2xo,3249
|
59
59
|
bec_widgets/widgets/dock/__init__.py,sha256=B7foHt02gnhM7mFksa7GJVwT7n0j_JvYDCt6wc6XR5g,61
|
60
|
-
bec_widgets/widgets/dock/dock.py,sha256=
|
60
|
+
bec_widgets/widgets/dock/dock.py,sha256=lEl6ppy0v-8X5bVX7EQIYka8rAakjkZyh6ufgr7YxKs,7595
|
61
61
|
bec_widgets/widgets/dock/dock_area.py,sha256=9c_tLzyBRllLfc4H5o9-4bvasWp5hWe1NWg4mupXVtU,7911
|
62
62
|
bec_widgets/widgets/figure/__init__.py,sha256=3hGx_KOV7QHCYAV06aNuUgKq4QIYCjUTad-DrwkUaBM,44
|
63
63
|
bec_widgets/widgets/figure/figure.py,sha256=3bf1TyzIE8kVRDgjLqdlvCoE4wrozyfbeCWLjCo1Fwo,31821
|
@@ -166,6 +166,7 @@ tests/unit_tests/test_motor_control.py,sha256=NBekcGALo5mYkuyBJvBhvJkWiQDV82hI4G
|
|
166
166
|
tests/unit_tests/test_plot_base.py,sha256=Akr_JgglUCrtERtdtsMqWko_MLUYoAYRGzV2sum-YHo,3836
|
167
167
|
tests/unit_tests/test_plugin_utils.py,sha256=PonKNpu4fZaFmKbI2v0tZJjZrsTvBGSF96bPHvKJvrE,608
|
168
168
|
tests/unit_tests/test_rpc_register.py,sha256=hECjZEimd440mwRrO0rg7L3PKN7__3DgjmESN6wx3bo,1179
|
169
|
+
tests/unit_tests/test_rpc_widget_handler.py,sha256=QC85N48UAFsROKRNkoDIfInzy1mLhp2buLVSJifkhiU,236
|
169
170
|
tests/unit_tests/test_scan_control.py,sha256=Xf8bGt8lRJobRwBoqUdVXxsHno8ejvC77FqprhF7Z6I,7564
|
170
171
|
tests/unit_tests/test_spiral_progress_bar.py,sha256=n5aLSZ2B6K5a1vQuKTERnCSmIz9hYGFyk7jP3TU0AwQ,12438
|
171
172
|
tests/unit_tests/test_stop_button.py,sha256=2OH9dhs_-S5QovPPgU-5hJoViE1YKZa0gxisb4vOY28,712
|
@@ -179,8 +180,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
179
180
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
180
181
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
181
182
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
182
|
-
bec_widgets-0.
|
183
|
-
bec_widgets-0.
|
184
|
-
bec_widgets-0.
|
185
|
-
bec_widgets-0.
|
186
|
-
bec_widgets-0.
|
183
|
+
bec_widgets-0.66.1.dist-info/METADATA,sha256=u-mGylcSYfdLA6I276ETlul9ZXRitI9ECVKvIBxHY8w,1302
|
184
|
+
bec_widgets-0.66.1.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
185
|
+
bec_widgets-0.66.1.dist-info/entry_points.txt,sha256=OvoqiNzNF9bizFQNhbAmmdc_njHrnVewLE-Kl-u9sh0,115
|
186
|
+
bec_widgets-0.66.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
187
|
+
bec_widgets-0.66.1.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|