bec-widgets 1.17.0__py3-none-any.whl → 1.17.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 CHANGED
@@ -1,6 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v1.17.1 (2025-01-26)
5
+
6
+ ### Bug Fixes
7
+
8
+ - **bec_signal_proxy**: Timeout for blocking implemented
9
+ ([`6f2f2aa`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6f2f2aa06ae9b50f0451029caa1d8d83890a5b30))
10
+
11
+
4
12
  ## v1.17.0 (2025-01-23)
5
13
 
6
14
  ### Bug Fixes
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 1.17.0
3
+ Version: 1.17.1
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -5,28 +5,43 @@ analyse data. Requesting a new fit may lead to request piling up and an overall
5
5
  will allow you to decide by yourself when to unblock and execute the callback again."""
6
6
 
7
7
  from pyqtgraph import SignalProxy
8
- from qtpy.QtCore import Signal, Slot
8
+ from qtpy.QtCore import QTimer, Signal
9
+
10
+ from bec_widgets.qt_utils.error_popups import SafeSlot
9
11
 
10
12
 
11
13
  class BECSignalProxy(SignalProxy):
12
- """Thin wrapper around the SignalProxy class to allow signal calls to be blocked, but args still being stored
14
+ """
15
+ Thin wrapper around the SignalProxy class to allow signal calls to be blocked,
16
+ but arguments still being stored.
13
17
 
14
18
  Args:
15
- *args: Arguments to pass to the SignalProxy class
16
- rateLimit (int): The rateLimit of the proxy
17
- **kwargs: Keyword arguments to pass to the SignalProxy class
19
+ *args: Arguments to pass to the SignalProxy class.
20
+ rateLimit (int): The rateLimit of the proxy.
21
+ timeout (float): The number of seconds after which the proxy automatically
22
+ unblocks if still blocked. Default is 10.0 seconds.
23
+ **kwargs: Keyword arguments to pass to the SignalProxy class.
18
24
 
19
25
  Example:
20
- >>> proxy = BECSignalProxy(signal, rate_limit=25, slot=callback)"""
26
+ >>> proxy = BECSignalProxy(signal, rate_limit=25, slot=callback)
27
+ """
21
28
 
22
29
  is_blocked = Signal(bool)
23
30
 
24
- def __init__(self, *args, rateLimit=25, **kwargs):
31
+ def __init__(self, *args, rateLimit=25, timeout=10.0, **kwargs):
25
32
  super().__init__(*args, rateLimit=rateLimit, **kwargs)
26
33
  self._blocking = False
27
34
  self.old_args = None
28
35
  self.new_args = None
29
36
 
37
+ # Store timeout value (in seconds)
38
+ self._timeout = timeout
39
+
40
+ # Create a single-shot timer for auto-unblocking
41
+ self._timer = QTimer()
42
+ self._timer.setSingleShot(True)
43
+ self._timer.timeout.connect(self._timeout_unblock)
44
+
30
45
  @property
31
46
  def blocked(self):
32
47
  """Returns if the proxy is blocked"""
@@ -46,9 +61,22 @@ class BECSignalProxy(SignalProxy):
46
61
  self.old_args = args
47
62
  super().signalReceived(*args)
48
63
 
49
- @Slot()
64
+ self._timer.start(int(self._timeout * 1000))
65
+
66
+ @SafeSlot()
50
67
  def unblock_proxy(self):
51
68
  """Unblock the proxy, and call the signalReceived method in case there was an update of the args."""
52
- self.blocked = False
53
- if self.new_args != self.old_args:
54
- self.signalReceived(*self.new_args)
69
+ if self.blocked:
70
+ self._timer.stop()
71
+ self.blocked = False
72
+ if self.new_args != self.old_args:
73
+ self.signalReceived(*self.new_args)
74
+
75
+ @SafeSlot()
76
+ def _timeout_unblock(self):
77
+ """
78
+ Internal method called by the QTimer upon timeout. Unblocks the proxy
79
+ automatically if it is still blocked.
80
+ """
81
+ if self.blocked:
82
+ self.unblock_proxy()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 1.17.0
3
+ Version: 1.17.1
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=CLlFGYRGKp4FxCPTkyF9p-7qx67KmbM9Yok9JQEU_Ls,8677
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=qgX1xiPmG7RoW1r93kPeYVnO1h710pEclbew4UQ5RaM,224623
5
+ CHANGELOG.md,sha256=Jc45hYcb-Nda1rAVVrG_G5rZZsVWbdCA3224lFwYZ-k,224827
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=y_KMJNgIR69OWoRZQQWDhQJ7xQIAaYNEVNWTnAQn3zk,1339
7
+ PKG-INFO,sha256=4V7myzZuKihozFHbacSECpJYlaTRLTsEKVOFSlp1vZo,1339
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=2NKYdrBf11D3GFzfCMHEDUVJ-kRiHl4wjqgKQ-Ix4w0,2596
9
+ pyproject.toml,sha256=yF_AhfRSbZ3Tq677Tt0cf6xCoPf_a9v0p4t2BQoRkyU,2596
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
@@ -62,7 +62,7 @@ bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U
62
62
  bec_widgets/utils/bec_connector.py,sha256=78QAlC7uAtxUW-7KTxoMUJu2aFve7IqnGkURYYNGFDo,10074
63
63
  bec_widgets/utils/bec_designer.py,sha256=XBy38NbNMoRDpvRx5lGP2XnJNG34YKZ7I-ARFkn-gzs,5017
64
64
  bec_widgets/utils/bec_dispatcher.py,sha256=OFmkx9vOz4pA4Sdc14QreyDZ870QYskJ4B5daVVeYg4,6325
65
- bec_widgets/utils/bec_signal_proxy.py,sha256=PKJ7v8pKrAaqA9XNDMZZBlhVtEInX-ae6_0m2cQhiEw,2107
65
+ bec_widgets/utils/bec_signal_proxy.py,sha256=soKdA4pJL8S0d-93C0QqcIUxLA4rfb1-B1jyRXHmMxk,3011
66
66
  bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
67
67
  bec_widgets/utils/bec_widget.py,sha256=1lrHNuvW6uOuPpr-cJBYJNbFekTsqpnQdfTo3P5tbWI,3330
68
68
  bec_widgets/utils/colors.py,sha256=zL9ieD_Bsb2ehd6tPpgfkhu1u5qrQRIE4mvoqM2iqko,16546
@@ -332,8 +332,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=Z
332
332
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
333
333
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
334
334
  bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
335
- bec_widgets-1.17.0.dist-info/METADATA,sha256=y_KMJNgIR69OWoRZQQWDhQJ7xQIAaYNEVNWTnAQn3zk,1339
336
- bec_widgets-1.17.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
337
- bec_widgets-1.17.0.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
338
- bec_widgets-1.17.0.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
339
- bec_widgets-1.17.0.dist-info/RECORD,,
335
+ bec_widgets-1.17.1.dist-info/METADATA,sha256=4V7myzZuKihozFHbacSECpJYlaTRLTsEKVOFSlp1vZo,1339
336
+ bec_widgets-1.17.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
337
+ bec_widgets-1.17.1.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
338
+ bec_widgets-1.17.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
339
+ bec_widgets-1.17.1.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "1.17.0"
7
+ version = "1.17.1"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [