bec-widgets 0.73.1__py3-none-any.whl → 0.73.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 +10 -12
- PKG-INFO +1 -1
- bec_widgets/cli/client_utils.py +1 -4
- bec_widgets/cli/server.py +5 -1
- bec_widgets/widgets/vscode/vscode.py +8 -1
- {bec_widgets-0.73.1.dist-info → bec_widgets-0.73.2.dist-info}/METADATA +1 -1
- {bec_widgets-0.73.1.dist-info → bec_widgets-0.73.2.dist-info}/RECORD +12 -12
- pyproject.toml +1 -1
- tests/unit_tests/test_vscode_widget.py +23 -6
- {bec_widgets-0.73.1.dist-info → bec_widgets-0.73.2.dist-info}/WHEEL +0 -0
- {bec_widgets-0.73.1.dist-info → bec_widgets-0.73.2.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.73.1.dist-info → bec_widgets-0.73.2.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.73.2 (2024-06-25)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix(vscode): only run terminate if the process is still alive ([`7120f3e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7120f3e93b054b788f15e2d5bcd688e3c140c1ce))
|
8
|
+
|
9
|
+
* fix(rpc): trigger shutdown of server when gui is terminated ([`acc1318`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/acc13183e28030e3ca9af21bb081e1eed081622b))
|
10
|
+
|
11
|
+
* fix(rpc): remove of calling "close" and waiting for gui_is_alive ([`f75fc19`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f75fc19c5b10022763252917ca473f404a25165a))
|
12
|
+
|
3
13
|
## v0.73.1 (2024-06-25)
|
4
14
|
|
5
15
|
### Fix
|
@@ -130,8 +140,6 @@
|
|
130
140
|
|
131
141
|
* feat: bec-gui-server: redirect stdout and stderr (if any) as proper debug and error log entries ([`d1266a1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d1266a1ce148ff89557a039e3a182a87a3948f49))
|
132
142
|
|
133
|
-
* feat: add logger for BEC GUI server ([`630616e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/630616ec729f60aa0b4d17a9e0379f9c6198eb96))
|
134
|
-
|
135
143
|
### Fix
|
136
144
|
|
137
145
|
* fix: ignore GUI server output (any output will go to log file)
|
@@ -141,13 +149,3 @@ stderr streams will be redirected as log entries with levels DEBUG or ERROR
|
|
141
149
|
in their parent process ([`ce37416`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ce374163cab87a92847409051739777bc505a77b))
|
142
150
|
|
143
151
|
* fix: do not create 'BECClient' logger when instantiating BECDispatcher ([`f7d0b07`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f7d0b0768ace42a33e2556bb33611d4f02e5a6d9))
|
144
|
-
|
145
|
-
## v0.67.0 (2024-06-21)
|
146
|
-
|
147
|
-
### Documentation
|
148
|
-
|
149
|
-
* docs: add widget to documentation ([`6fa1c06`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6fa1c06053131dabd084bb3cf13c853b5d3ce833))
|
150
|
-
|
151
|
-
### Refactor
|
152
|
-
|
153
|
-
* refactor: Change inheritance to QTreeWidget from QWidget ([`d2f2b20`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d2f2b206bb0eab60b8a9b0d0ac60a6b7887fa6fb))
|
PKG-INFO
CHANGED
bec_widgets/cli/client_utils.py
CHANGED
@@ -203,15 +203,12 @@ class BECGuiClientMixin:
|
|
203
203
|
if self._process is None:
|
204
204
|
return
|
205
205
|
|
206
|
-
self._run_rpc("close", (), wait_for_rpc_response=False)
|
207
|
-
while self.gui_is_alive():
|
208
|
-
time.sleep(0.2)
|
209
|
-
|
210
206
|
self._client.shutdown()
|
211
207
|
if self._process:
|
212
208
|
self._process.terminate()
|
213
209
|
if self._process_output_processing_thread:
|
214
210
|
self._process_output_processing_thread.join()
|
211
|
+
self._process.wait()
|
215
212
|
self._process = None
|
216
213
|
|
217
214
|
|
bec_widgets/cli/server.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
1
3
|
import inspect
|
2
4
|
import signal
|
3
5
|
import sys
|
@@ -29,7 +31,7 @@ class BECWidgetsCLIServer:
|
|
29
31
|
dispatcher: BECDispatcher = None,
|
30
32
|
client=None,
|
31
33
|
config=None,
|
32
|
-
gui_class: Union[
|
34
|
+
gui_class: Union[BECFigure, BECDockArea] = BECFigure,
|
33
35
|
) -> None:
|
34
36
|
self.dispatcher = BECDispatcher(config=config) if dispatcher is None else dispatcher
|
35
37
|
self.client = self.dispatcher.client if client is None else client
|
@@ -118,6 +120,7 @@ class BECWidgetsCLIServer:
|
|
118
120
|
def shutdown(self): # TODO not sure if needed when cleanup is done at level of BECConnector
|
119
121
|
self._shutdown_event = True
|
120
122
|
self._heartbeat_timer.stop()
|
123
|
+
self.gui.close()
|
121
124
|
self.client.shutdown()
|
122
125
|
|
123
126
|
|
@@ -207,6 +210,7 @@ def main():
|
|
207
210
|
app.quit()
|
208
211
|
|
209
212
|
signal.signal(signal.SIGINT, sigint_handler)
|
213
|
+
signal.signal(signal.SIGTERM, sigint_handler)
|
210
214
|
|
211
215
|
sys.exit(app.exec())
|
212
216
|
|
@@ -60,7 +60,7 @@ class VSCodeEditor(WebsiteWidget):
|
|
60
60
|
"""
|
61
61
|
Cleanup the VSCode editor.
|
62
62
|
"""
|
63
|
-
if not self.process:
|
63
|
+
if not self.process or self.process.poll() is not None:
|
64
64
|
return
|
65
65
|
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
|
66
66
|
self.process.wait()
|
@@ -72,6 +72,13 @@ class VSCodeEditor(WebsiteWidget):
|
|
72
72
|
self.cleanup_vscode()
|
73
73
|
return super().cleanup()
|
74
74
|
|
75
|
+
def close(self):
|
76
|
+
"""
|
77
|
+
Close the widget.
|
78
|
+
"""
|
79
|
+
self.cleanup_vscode()
|
80
|
+
return super().close()
|
81
|
+
|
75
82
|
|
76
83
|
if __name__ == "__main__": # pragma: no cover
|
77
84
|
import sys
|
@@ -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=1gxCAwPtBXbKQBu8qYGoa5nGPpVo9mCugMJxicel-5Q,7381
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=j218s_gIgChSd6XQlMySe16wGrVOcS0MEPCZ7S4vU_g,1302
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=f65NttBDHT4IZg0T5qIH5y4QGERQQggr_98iBUPQ5IM,2215
|
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
|
@@ -18,11 +18,11 @@ bec_widgets/assets/terminal_icon.png,sha256=bJl7Tft4Fi2uxvuXI8o14uMHnI9eAWKSU2uf
|
|
18
18
|
bec_widgets/cli/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
|
19
19
|
bec_widgets/cli/auto_updates.py,sha256=DyBV3HnjMSH-cvVkYNcDiYKVf0Xut4Qy2qGQqkW47Bw,4833
|
20
20
|
bec_widgets/cli/client.py,sha256=faWHDMG9mwD1fB5ptuZ-_QWka0Lrv9iJ94QupwmqCmY,59358
|
21
|
-
bec_widgets/cli/client_utils.py,sha256=
|
21
|
+
bec_widgets/cli/client_utils.py,sha256=zq1gPW7t4n9Nsn4MLkdUeKwwl-9nUcf5UjuN8lZr9iY,12281
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=InKBVYM7DRfAVLNJhRJbWWSSPBQBHI8Ek6v7NCsK0ME,4997
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
24
24
|
bec_widgets/cli/rpc_wigdet_handler.py,sha256=1qQOGrM8rozaWLkoxAW8DTVLv_L_DZdZgUMDPy5MOek,1486
|
25
|
-
bec_widgets/cli/server.py,sha256=
|
25
|
+
bec_widgets/cli/server.py,sha256=2EJvkQDzrDTsZjRPs7g2v_iPTspGqxzY34tRAnvjxjY,7281
|
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
|
28
28
|
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=VdX3OwlIiUCD4b75MQS4YwLLaZGvsJ-z3QFPe2y9f78,5343
|
@@ -118,7 +118,7 @@ bec_widgets/widgets/text_box/text_box.py,sha256=kykQ_Zcxh8IGcPEP5-oGGQwoZEpY9vhx
|
|
118
118
|
bec_widgets/widgets/toolbar/__init__.py,sha256=d-TP4_cr_VbpwreMM4ePnfZ5YXsEPQ45ibEf75nuGoE,36
|
119
119
|
bec_widgets/widgets/toolbar/toolbar.py,sha256=e0zCD_0q7K4NVhrzD8001Qvfxt-VhqHTgofchS9NgCM,5125
|
120
120
|
bec_widgets/widgets/vscode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
121
|
-
bec_widgets/widgets/vscode/vscode.py,sha256=
|
121
|
+
bec_widgets/widgets/vscode/vscode.py,sha256=ZyJJCJapYrGhqgudEt8JQn723DDqLdwjsXxXa5q3EkU,2544
|
122
122
|
bec_widgets/widgets/website/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
123
|
bec_widgets/widgets/website/website.py,sha256=Scvpl4I52qpL7s69tnNBRQSG6GcRI9jzoR3RsSTXfPE,1722
|
124
124
|
docs/Makefile,sha256=i2WHuFlgfyAPEW4ssEP8NY4cOibDJrVjvzSEU8_Ggwc,634
|
@@ -201,7 +201,7 @@ tests/unit_tests/test_scan_control.py,sha256=Wr6KcE8av4sEIOx5VgYbzVCem3Jgb4Kzx_o
|
|
201
201
|
tests/unit_tests/test_scan_control_group_box.py,sha256=HNqjP10B_NonikspNwKz9upJU-t7xf6hwBerNhbC-uo,5563
|
202
202
|
tests/unit_tests/test_stop_button.py,sha256=2OH9dhs_-S5QovPPgU-5hJoViE1YKZa0gxisb4vOY28,712
|
203
203
|
tests/unit_tests/test_text_box_widget.py,sha256=cT0uEHt_6d-FwST0A_wE9sFW9E3F_nJbKhuBAeU4yHg,1862
|
204
|
-
tests/unit_tests/test_vscode_widget.py,sha256=
|
204
|
+
tests/unit_tests/test_vscode_widget.py,sha256=NVB23ppLqIj-Opd8QnapqUJzDMz6mIZfm3wGPnFXyUE,2788
|
205
205
|
tests/unit_tests/test_waveform1d.py,sha256=I3_pF0ieltcTWtweOBjICaOxJ8NCQ0-NWxpKg8Pas3E,15893
|
206
206
|
tests/unit_tests/test_website_widget.py,sha256=fBADIJJBAHU4Ro7u95kdemFVNv196UOcuO9oLHuHt8A,761
|
207
207
|
tests/unit_tests/test_widget_io.py,sha256=FeL3ZYSBQnRt6jxj8VGYw1cmcicRQyHKleahw7XIyR0,3475
|
@@ -211,8 +211,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
211
211
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
212
212
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
213
213
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
214
|
-
bec_widgets-0.73.
|
215
|
-
bec_widgets-0.73.
|
216
|
-
bec_widgets-0.73.
|
217
|
-
bec_widgets-0.73.
|
218
|
-
bec_widgets-0.73.
|
214
|
+
bec_widgets-0.73.2.dist-info/METADATA,sha256=j218s_gIgChSd6XQlMySe16wGrVOcS0MEPCZ7S4vU_g,1302
|
215
|
+
bec_widgets-0.73.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
216
|
+
bec_widgets-0.73.2.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
217
|
+
bec_widgets-0.73.2.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
218
|
+
bec_widgets-0.73.2.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -46,7 +46,8 @@ def test_start_server(qtbot, mocked_client):
|
|
46
46
|
)
|
47
47
|
|
48
48
|
|
49
|
-
|
49
|
+
@pytest.fixture
|
50
|
+
def patched_vscode_process(qtbot, vscode_widget):
|
50
51
|
with mock.patch("bec_widgets.widgets.vscode.vscode.os.killpg") as mock_killpg:
|
51
52
|
with mock.patch("bec_widgets.widgets.vscode.vscode.os.getpgid") as mock_getpgid:
|
52
53
|
with mock.patch(
|
@@ -54,8 +55,24 @@ def test_close_event(qtbot, vscode_widget):
|
|
54
55
|
) as mock_close_event:
|
55
56
|
mock_getpgid.return_value = 123
|
56
57
|
vscode_widget.process = mock.Mock()
|
57
|
-
vscode_widget
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
yield vscode_widget, mock_killpg, mock_close_event
|
59
|
+
|
60
|
+
|
61
|
+
def test_close_event(qtbot, patched_vscode_process):
|
62
|
+
vscode_patched, mock_killpg, mock_close_event = patched_vscode_process
|
63
|
+
vscode_patched.process.pid = 123
|
64
|
+
vscode_patched.process.poll.return_value = None
|
65
|
+
vscode_patched.closeEvent(None)
|
66
|
+
mock_killpg.assert_called_once_with(123, 15)
|
67
|
+
vscode_patched.process.wait.assert_called_once()
|
68
|
+
mock_close_event.assert_called_once()
|
69
|
+
|
70
|
+
|
71
|
+
def test_close_event_on_terminated_code(qtbot, patched_vscode_process):
|
72
|
+
vscode_patched, mock_killpg, mock_close_event = patched_vscode_process
|
73
|
+
vscode_patched.process.pid = 123
|
74
|
+
vscode_patched.process.poll.return_value = 0
|
75
|
+
vscode_patched.closeEvent(None)
|
76
|
+
mock_killpg.assert_not_called()
|
77
|
+
vscode_patched.process.wait.assert_not_called()
|
78
|
+
mock_close_event.assert_called_once()
|
File without changes
|
File without changes
|
File without changes
|