bec-widgets 2.9.1__py3-none-any.whl → 2.9.2__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 +14 -0
- PKG-INFO +1 -1
- bec_widgets/widgets/utility/logpanel/logpanel.py +30 -27
- {bec_widgets-2.9.1.dist-info → bec_widgets-2.9.2.dist-info}/METADATA +1 -1
- {bec_widgets-2.9.1.dist-info → bec_widgets-2.9.2.dist-info}/RECORD +9 -9
- pyproject.toml +1 -1
- {bec_widgets-2.9.1.dist-info → bec_widgets-2.9.2.dist-info}/WHEEL +0 -0
- {bec_widgets-2.9.1.dist-info → bec_widgets-2.9.2.dist-info}/entry_points.txt +0 -0
- {bec_widgets-2.9.1.dist-info → bec_widgets-2.9.2.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
|
4
|
+
## v2.9.2 (2025-05-30)
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
- Logpanel error cycle
|
9
|
+
([`d9dc60e`](https://github.com/bec-project/bec_widgets/commit/d9dc60ee9974e2e6e6005378cc17ef088a4ded2c))
|
10
|
+
|
11
|
+
- Move log panel to bec connector and add rate limiter
|
12
|
+
([`7322cd1`](https://github.com/bec-project/bec_widgets/commit/7322cd194fcf7f56d41c86ecbcd97a5d8bd60c3e))
|
13
|
+
|
14
|
+
- **log_panel**: Removed lambda callback method
|
15
|
+
([`9112616`](https://github.com/bec-project/bec_widgets/commit/91126168b62f3e1623521ceb205dd854287cfef7))
|
16
|
+
|
17
|
+
|
4
18
|
## v2.9.1 (2025-05-30)
|
5
19
|
|
6
20
|
### Bug Fixes
|
PKG-INFO
CHANGED
@@ -11,12 +11,11 @@ from re import Pattern
|
|
11
11
|
from typing import TYPE_CHECKING, Literal
|
12
12
|
|
13
13
|
from bec_lib.client import BECClient
|
14
|
-
from bec_lib.connector import ConnectorBase
|
15
14
|
from bec_lib.endpoints import MessageEndpoints
|
16
15
|
from bec_lib.logger import LogLevel, bec_logger
|
17
16
|
from bec_lib.messages import LogMessage, StatusMessage
|
18
|
-
from
|
19
|
-
from qtpy.QtCore import QDateTime, Qt, Signal
|
17
|
+
from pyqtgraph import SignalProxy
|
18
|
+
from qtpy.QtCore import QDateTime, QObject, Qt, Signal
|
20
19
|
from qtpy.QtGui import QFont
|
21
20
|
from qtpy.QtWidgets import (
|
22
21
|
QApplication,
|
@@ -35,6 +34,7 @@ from qtpy.QtWidgets import (
|
|
35
34
|
QWidget,
|
36
35
|
)
|
37
36
|
|
37
|
+
from bec_widgets.utils.bec_connector import BECConnector
|
38
38
|
from bec_widgets.utils.colors import get_theme_palette, set_theme
|
39
39
|
from bec_widgets.utils.error_popups import SafeSlot
|
40
40
|
from bec_widgets.widgets.editors.text_box.text_box import TextBox
|
@@ -69,22 +69,22 @@ DEFAULT_LOG_COLORS = {
|
|
69
69
|
}
|
70
70
|
|
71
71
|
|
72
|
-
class BecLogsQueue(QObject):
|
72
|
+
class BecLogsQueue(BECConnector, QObject):
|
73
73
|
"""Manages getting logs from BEC Redis and formatting them for display"""
|
74
74
|
|
75
|
+
RPC = False
|
75
76
|
new_message = Signal()
|
76
77
|
|
77
78
|
def __init__(
|
78
79
|
self,
|
79
80
|
parent: QObject | None,
|
80
|
-
conn: ConnectorBase,
|
81
81
|
maxlen: int = 1000,
|
82
82
|
line_formatter: LineFormatter = noop_format,
|
83
|
+
**kwargs,
|
83
84
|
) -> None:
|
84
|
-
super().__init__(parent=parent)
|
85
|
+
super().__init__(parent=parent, **kwargs)
|
85
86
|
self._timestamp_start: QDateTime | None = None
|
86
87
|
self._timestamp_end: QDateTime | None = None
|
87
|
-
self._conn = conn
|
88
88
|
self._max_length = maxlen
|
89
89
|
self._data: deque[LogMessage] = deque([], self._max_length)
|
90
90
|
self._display_queue: deque[str] = deque([], self._max_length)
|
@@ -92,20 +92,26 @@ class BecLogsQueue(QObject):
|
|
92
92
|
self._search_query: Pattern | str | None = None
|
93
93
|
self._selected_services: set[str] | None = None
|
94
94
|
self._set_formatter_and_update_filter(line_formatter)
|
95
|
-
|
95
|
+
# instance attribute still accessible after c++ object is deleted, so the callback can be unregistered
|
96
|
+
self.bec_dispatcher.connect_slot(self._process_incoming_log_msg, MessageEndpoints.log())
|
96
97
|
|
97
|
-
def
|
98
|
+
def cleanup(self, *_):
|
98
99
|
"""Stop listening to the Redis log stream"""
|
99
|
-
self.
|
100
|
+
self.bec_dispatcher.disconnect_slot(
|
101
|
+
self._process_incoming_log_msg, [MessageEndpoints.log()]
|
102
|
+
)
|
100
103
|
|
101
|
-
|
104
|
+
@SafeSlot(verify_sender=True)
|
105
|
+
def _process_incoming_log_msg(self, msg: dict, _metadata: dict):
|
102
106
|
try:
|
103
|
-
_msg
|
107
|
+
_msg = LogMessage(**msg)
|
104
108
|
self._data.append(_msg)
|
105
109
|
if self.filter is None or self.filter(_msg):
|
106
110
|
self._display_queue.append(self._line_formatter(_msg))
|
107
111
|
self.new_message.emit()
|
108
112
|
except Exception as e:
|
113
|
+
if "Internal C++ object (BecLogsQueue) already deleted." in e.args:
|
114
|
+
return
|
109
115
|
logger.warning(f"Error in LogPanel incoming message callback: {e}")
|
110
116
|
|
111
117
|
def _set_formatter_and_update_filter(self, line_formatter: LineFormatter = noop_format):
|
@@ -202,7 +208,7 @@ class BecLogsQueue(QObject):
|
|
202
208
|
"""Fetch all available messages from Redis"""
|
203
209
|
self._data = deque(
|
204
210
|
item["data"]
|
205
|
-
for item in self.
|
211
|
+
for item in self.bec_dispatcher.client.connector.xread(
|
206
212
|
MessageEndpoints.log().endpoint, from_start=True, count=self._max_length
|
207
213
|
)
|
208
214
|
)
|
@@ -396,7 +402,6 @@ class LogPanel(TextBox):
|
|
396
402
|
"""Displays a log panel"""
|
397
403
|
|
398
404
|
ICON_NAME = "terminal"
|
399
|
-
_new_messages = Signal()
|
400
405
|
service_list_update = Signal(dict, set)
|
401
406
|
|
402
407
|
def __init__(
|
@@ -407,17 +412,17 @@ class LogPanel(TextBox):
|
|
407
412
|
**kwargs,
|
408
413
|
):
|
409
414
|
"""Initialize the LogPanel widget."""
|
410
|
-
super().__init__(parent=parent, client=client, **kwargs)
|
415
|
+
super().__init__(parent=parent, client=client, config={"text": ""}, **kwargs)
|
411
416
|
self._update_colors()
|
412
417
|
self._service_status = service_status or BECServiceStatusMixin(self, client=self.client) # type: ignore
|
413
418
|
self._log_manager = BecLogsQueue(
|
414
|
-
parent,
|
415
|
-
|
416
|
-
|
419
|
+
parent=self, line_formatter=partial(simple_color_format, colors=self._colors)
|
420
|
+
)
|
421
|
+
self._proxy_update = SignalProxy(
|
422
|
+
self._log_manager.new_message, rateLimit=1, slot=self._on_append
|
417
423
|
)
|
418
|
-
self._log_manager.new_message.connect(self._new_messages)
|
419
424
|
|
420
|
-
self.toolbar = LogPanelToolbar(parent=
|
425
|
+
self.toolbar = LogPanelToolbar(parent=self)
|
421
426
|
self.toolbar_area = QScrollArea()
|
422
427
|
self.toolbar_area.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
423
428
|
self.toolbar_area.setSizeAdjustPolicy(QScrollArea.SizeAdjustPolicy.AdjustToContents)
|
@@ -431,7 +436,6 @@ class LogPanel(TextBox):
|
|
431
436
|
self.toolbar.search_textbox.returnPressed.connect(self._on_re_update)
|
432
437
|
self.toolbar.regex_enabled.checkStateChanged.connect(self._on_re_update)
|
433
438
|
self.toolbar.filter_level_dropdown.currentTextChanged.connect(self._set_level_filter)
|
434
|
-
self._new_messages.connect(self._on_append)
|
435
439
|
|
436
440
|
self.toolbar.timerange_button.clicked.connect(self._choose_datetime)
|
437
441
|
self._service_status.services_update.connect(self._update_service_list)
|
@@ -483,10 +487,10 @@ class LogPanel(TextBox):
|
|
483
487
|
self.set_html_text(self._log_manager.display_all())
|
484
488
|
self._cursor_to_end()
|
485
489
|
|
486
|
-
@SafeSlot()
|
487
|
-
def _on_append(self):
|
488
|
-
self._cursor_to_end()
|
490
|
+
@SafeSlot(verify_sender=True)
|
491
|
+
def _on_append(self, *_):
|
489
492
|
self.text_box_text_edit.insertHtml(self._log_manager.format_new())
|
493
|
+
self._cursor_to_end()
|
490
494
|
|
491
495
|
@SafeSlot()
|
492
496
|
def _on_clear(self):
|
@@ -529,9 +533,8 @@ class LogPanel(TextBox):
|
|
529
533
|
|
530
534
|
def cleanup(self):
|
531
535
|
self._service_status.cleanup()
|
532
|
-
self._log_manager.
|
533
|
-
self._log_manager.
|
534
|
-
self._new_messages.disconnect(self._on_append)
|
536
|
+
self._log_manager.cleanup()
|
537
|
+
self._log_manager.deleteLater()
|
535
538
|
super().cleanup()
|
536
539
|
|
537
540
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=1nMYldzVk0tFkBWYTcUjumOrdSADASheWOAc0kOFDYs,9509
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=ivqg3HTaOxNbEW3bzWh9MXAkrekuGoNdj0Mj3SdRYuw,639
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=bvLvRqY1ti9KM07FKZJ4inx8IJHEFQs5h_45NJsivqA,291463
|
6
6
|
LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=5wQ2vrdqE7xubenzvjLi16nZCbSMeHrxinhbT5-p-4M,1273
|
8
8
|
README.md,sha256=oY5Jc1uXehRASuwUJ0umin2vfkFh7tHF-LLruHTaQx0,3560
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=wBhUzRBdzjF8GIWoZDMWlJeT4KjYdU3O6Hu0gsc8dgQ,2902
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.github/pull_request_template.md,sha256=F_cJXzooWMFgMGtLK-7KeGcQt0B4AYFse5oN0zQ9p6g,801
|
12
12
|
.github/ISSUE_TEMPLATE/bug_report.yml,sha256=WdRnt7HGxvsIBLzhkaOWNfg8IJQYa_oV9_F08Ym6znQ,1081
|
@@ -361,7 +361,7 @@ bec_widgets/widgets/utility/logpanel/__init__.py,sha256=HldSvPLYgrqBjCgIQj0f7Wa4
|
|
361
361
|
bec_widgets/widgets/utility/logpanel/_util.py,sha256=GqzHbdOTmWBru9OR4weeYdziWj_cWxqSJhS4_6W3Qjg,1836
|
362
362
|
bec_widgets/widgets/utility/logpanel/log_panel.pyproject,sha256=2ncs1bsu-wICstR1gOYwFFdr0UuZmrBQEpwhvNKVFMY,26
|
363
363
|
bec_widgets/widgets/utility/logpanel/log_panel_plugin.py,sha256=KY7eS1uGZzLYtDAdBv6S2mw8UjcDGVt3UklN_D5M06A,1250
|
364
|
-
bec_widgets/widgets/utility/logpanel/logpanel.py,sha256=
|
364
|
+
bec_widgets/widgets/utility/logpanel/logpanel.py,sha256=5c59r1Z368mqIZhS_0075P4gg2G1sK5NvPFMK5B1DuQ,20861
|
365
365
|
bec_widgets/widgets/utility/logpanel/register_log_panel.py,sha256=LFUE5JzCYvIwJQtTqZASLVAHYy3gO1nrHzPVH_kpCEY,470
|
366
366
|
bec_widgets/widgets/utility/signal_label/register_signal_label.py,sha256=wDB4Q3dSbZ51hsxnuB74oXdMRoLgDRd-XfhaomYY2OA,483
|
367
367
|
bec_widgets/widgets/utility/signal_label/signal_label.py,sha256=bht1zpHKxrslfFCknnLe3Q9FeF8Do0j6onWAiLXZan0,15875
|
@@ -408,8 +408,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=O
|
|
408
408
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
|
409
409
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
|
410
410
|
bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
|
411
|
-
bec_widgets-2.9.
|
412
|
-
bec_widgets-2.9.
|
413
|
-
bec_widgets-2.9.
|
414
|
-
bec_widgets-2.9.
|
415
|
-
bec_widgets-2.9.
|
411
|
+
bec_widgets-2.9.2.dist-info/METADATA,sha256=5wQ2vrdqE7xubenzvjLi16nZCbSMeHrxinhbT5-p-4M,1273
|
412
|
+
bec_widgets-2.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
413
|
+
bec_widgets-2.9.2.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
|
414
|
+
bec_widgets-2.9.2.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
415
|
+
bec_widgets-2.9.2.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|