bec-widgets 0.50.2__py3-none-any.whl → 0.51.0__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.
@@ -0,0 +1,40 @@
1
+ import inspect
2
+
3
+ from bec_lib.plugin_helper import _get_available_plugins
4
+
5
+ from bec_widgets.utils import BECConnector
6
+
7
+
8
+ def get_plugin_widgets() -> dict[str, BECConnector]:
9
+ """
10
+ Get all available widgets from the plugin directory. Widgets are classes that inherit from BECConnector.
11
+ The plugins are provided through python plugins and specified in the respective pyproject.toml file using
12
+ the following key:
13
+
14
+ [project.entry-points."bec.widgets.user_widgets"]
15
+ plugin_widgets = "path.to.plugin.module"
16
+
17
+ e.g.
18
+ [project.entry-points."bec.widgets.user_widgets"]
19
+ plugin_widgets = "pxiii_bec.bec_widgets.widgets"
20
+
21
+ assuming that the widgets module for the package pxiii_bec is located at pxiii_bec/bec_widgets/widgets and
22
+ contains the widgets to be loaded within the pxiii_bec/bec_widgets/widgets/__init__.py file.
23
+
24
+ Returns:
25
+ dict[str, BECConnector]: A dictionary of widget names and their respective classes.
26
+ """
27
+ modules = _get_available_plugins("bec.widgets.user_widgets")
28
+ loaded_plugins = {}
29
+ print(modules)
30
+ for module in modules:
31
+ mods = inspect.getmembers(module, predicate=_filter_plugins)
32
+ for name, mod_cls in mods:
33
+ if name in loaded_plugins:
34
+ print(f"Duplicated widgets plugin {name}.")
35
+ loaded_plugins[name] = mod_cls
36
+ return loaded_plugins
37
+
38
+
39
+ def _filter_plugins(obj):
40
+ return inspect.isclass(obj) and issubclass(obj, BECConnector)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bec-widgets
3
- Version: 0.50.2
3
+ Version: 0.51.0
4
4
  Summary: BEC Widgets
5
5
  Home-page: https://gitlab.psi.ch/bec/bec-widgets
6
6
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec-widgets/issues
@@ -12,8 +12,7 @@ Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: pydantic
14
14
  Requires-Dist: qtconsole
15
- Requires-Dist: PyQt6-Qt6 <=6.6.3
16
- Requires-Dist: PyQt6 <=6.6.3
15
+ Requires-Dist: PyQt6 >=6.7
17
16
  Requires-Dist: jedi
18
17
  Requires-Dist: qtpy
19
18
  Requires-Dist: pyqtgraph
@@ -30,10 +29,11 @@ Requires-Dist: coverage ; extra == 'dev'
30
29
  Requires-Dist: pytest-qt ; extra == 'dev'
31
30
  Requires-Dist: black ; extra == 'dev'
32
31
  Requires-Dist: isort ; extra == 'dev'
32
+ Requires-Dist: fakeredis ; extra == 'dev'
33
33
  Provides-Extra: pyqt5
34
34
  Requires-Dist: PyQt5 >=5.9 ; extra == 'pyqt5'
35
35
  Provides-Extra: pyqt6
36
- Requires-Dist: PyQt6 <=6.6.3 ; extra == 'pyqt6'
36
+ Requires-Dist: PyQt6 >=6.7 ; extra == 'pyqt6'
37
37
 
38
38
  # BEC Widgets
39
39
 
@@ -43,14 +43,14 @@ BEC Widgets is a GUI framework designed for interaction with [BEC (Beamline Expe
43
43
  Use the package manager [pip](https://pip.pypa.io/en/stable/) to install BEC Widgets:
44
44
 
45
45
  ```bash
46
- pip install bec-widgets
46
+ pip install bec_widgets
47
47
  ```
48
48
 
49
49
  For development purposes, you can clone the repository and install the package locally in editable mode:
50
50
 
51
51
  ```bash
52
52
  git clone https://gitlab.psi.ch/bec/bec-widgets
53
- cd bec-widgets
53
+ cd bec_widgets
54
54
  pip install -e .[dev]
55
55
  ```
56
56
 
@@ -59,12 +59,12 @@ BEC Widgets currently supports both PyQt5 and PyQt6. By default, PyQt6 is instal
59
59
  To select a specific Python Qt distribution, install the package with an additional tag:
60
60
 
61
61
  ```bash
62
- pip install bec-widgets[pyqt6]
62
+ pip install bec_widgets[pyqt6]
63
63
  ```
64
64
  or
65
65
 
66
66
  ```bash
67
- pip install bec-widgets[pyqt5]
67
+ pip install bec_widgets[pyqt5]
68
68
  ```
69
69
  ## Documentation
70
70
 
@@ -37,6 +37,7 @@ bec_widgets/utils/container_utils.py,sha256=rL-ryupQ4-7Y8mKNup5aklXleOfXSd97uwXT
37
37
  bec_widgets/utils/crosshair.py,sha256=5gG4G6jjtp6Bd1Y5EySHP2EkmtR4mYdxLCgVtx9fokE,9406
38
38
  bec_widgets/utils/ctrl_c.py,sha256=NMJlPDZcuqMUGykyhuZY5Ibed4yRI1K_uh16z2MmlXQ,1198
39
39
  bec_widgets/utils/entry_validator.py,sha256=88OpJqaldMjiaEk7F9rRcwPuCOTLCzXmAlSEL-_7iXU,1296
40
+ bec_widgets/utils/plugin_utils.py,sha256=wi5x7VVFee0PqAcP-EqPWjYfSe-LLhaK93y6qmnbLIw,1487
40
41
  bec_widgets/utils/rpc_decorator.py,sha256=pIvtqySQLnuS7l2Ti_UAe4WX7CRivZnsE5ZdKAihxh0,479
41
42
  bec_widgets/utils/thread_checker.py,sha256=rDNuA3X6KQyA7JPb67mccTg0z8YkInynLAENQDQpbuE,1607
42
43
  bec_widgets/utils/validator_delegate.py,sha256=Emj1WF6W8Ke1ruBWUfmHdVJpmOSPezuOt4zvQTay_44,442
@@ -99,8 +100,8 @@ tests/unit_tests/test_widget_io.py,sha256=FeL3ZYSBQnRt6jxj8VGYw1cmcicRQyHKleahw7
99
100
  tests/unit_tests/test_yaml_dialog.py,sha256=HNrqferkdg02-9ieOhhI2mr2Qvt7GrYgXmQ061YCTbg,5794
100
101
  tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
102
  tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
102
- bec_widgets-0.50.2.dist-info/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
103
- bec_widgets-0.50.2.dist-info/METADATA,sha256=1y0vUcfn4EHSqdP0RgJQ99mJRfVR1Qq7u16T95__1S4,3719
104
- bec_widgets-0.50.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
105
- bec_widgets-0.50.2.dist-info/top_level.txt,sha256=EXCwhJYmXmd1DjYYL3hrGsddX-97IwYSiIHrf27FFVk,18
106
- bec_widgets-0.50.2.dist-info/RECORD,,
103
+ bec_widgets-0.51.0.dist-info/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
104
+ bec_widgets-0.51.0.dist-info/METADATA,sha256=PwzbcGJ0Sy4MSwKmxEb2lh4XZVPxC_fHNjHyHVcPFHg,3724
105
+ bec_widgets-0.51.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
106
+ bec_widgets-0.51.0.dist-info/top_level.txt,sha256=EXCwhJYmXmd1DjYYL3hrGsddX-97IwYSiIHrf27FFVk,18
107
+ bec_widgets-0.51.0.dist-info/RECORD,,