bec-ipython-client 3.115.1__tar.gz → 3.115.2__tar.gz
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.
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/PKG-INFO +1 -1
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/bec_startup.py +46 -11
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/pyproject.toml +1 -1
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/.gitignore +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/beamline_mixin.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/bec_magics.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/device_progress.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/ipython_live_updates.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/live_table.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/move_device.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/utils.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/high_level_interfaces/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/high_level_interfaces/bec_hli.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/high_level_interfaces/spec_hli.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/main.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/SLS/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/SLS/sls_info.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/XTreme/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/XTreme/x-treme.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/__init__.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/flomni/flomni_config.yaml +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/prettytable.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/progressbar.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/signals.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/demo.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/conftest.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_beamline_mixins.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_bec_client.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_device_progress.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_ipython_live_updates.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_live_table.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_move_callback.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_pretty_table.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/conftest.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/_ensure_requirements_container.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/test_procedures_e2e.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/test_scans_e2e.py +0 -0
- {bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/test_scans_lib_e2e.py +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
import threading
|
|
4
3
|
|
|
5
4
|
import numpy as np # not needed but always nice to have
|
|
6
5
|
|
|
@@ -11,13 +10,47 @@ from bec_lib.acl_login import BECAuthenticationError
|
|
|
11
10
|
from bec_lib.logger import bec_logger as _bec_logger
|
|
12
11
|
from bec_lib.redis_connector import RedisConnector as _RedisConnector
|
|
13
12
|
|
|
14
|
-
try:
|
|
15
|
-
from bec_widgets.cli.client_utils import BECGuiClient
|
|
16
|
-
except ImportError:
|
|
17
|
-
BECGuiClient = None
|
|
18
|
-
|
|
19
13
|
logger = _bec_logger.logger
|
|
20
14
|
|
|
15
|
+
|
|
16
|
+
class _LazyBECGuiClient:
|
|
17
|
+
"""Defer BEC Widgets import while preserving the interactive ``gui`` object."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, gui_id: str | None = None):
|
|
20
|
+
self._gui_id = gui_id
|
|
21
|
+
self._client = None
|
|
22
|
+
|
|
23
|
+
def _materialize(self):
|
|
24
|
+
if self._client is None:
|
|
25
|
+
try:
|
|
26
|
+
from bec_widgets.cli.client_utils import BECGuiClient
|
|
27
|
+
except ImportError:
|
|
28
|
+
logger.warning("BEC Widgets is not available; skipping GUI startup.")
|
|
29
|
+
bec.gui = None
|
|
30
|
+
globals().pop("gui", None)
|
|
31
|
+
raise
|
|
32
|
+
|
|
33
|
+
self._client = BECGuiClient()
|
|
34
|
+
if self._gui_id:
|
|
35
|
+
self._client.connect_to_gui_server(self._gui_id)
|
|
36
|
+
bec.gui = self._client
|
|
37
|
+
globals()["gui"] = self._client
|
|
38
|
+
return self._client
|
|
39
|
+
|
|
40
|
+
def __getattr__(self, name):
|
|
41
|
+
return getattr(self._materialize(), name)
|
|
42
|
+
|
|
43
|
+
def __setattr__(self, name, value):
|
|
44
|
+
if name.startswith("_"):
|
|
45
|
+
return super().__setattr__(name, value)
|
|
46
|
+
return setattr(self._materialize(), name, value)
|
|
47
|
+
|
|
48
|
+
def __repr__(self) -> str:
|
|
49
|
+
if self._client is None:
|
|
50
|
+
return "LazyBECGuiClient(uninitialized)"
|
|
51
|
+
return repr(self._client)
|
|
52
|
+
|
|
53
|
+
|
|
21
54
|
bec = _BECIPythonClient(
|
|
22
55
|
_main_dict["config"], _RedisConnector, wait_for_server=_main_dict["wait_for_server"]
|
|
23
56
|
)
|
|
@@ -32,12 +65,14 @@ except (BECAuthenticationError, KeyboardInterrupt) as exc:
|
|
|
32
65
|
except Exception:
|
|
33
66
|
sys.excepthook(*sys.exc_info())
|
|
34
67
|
else:
|
|
35
|
-
if bec.started
|
|
36
|
-
gui = bec.gui =
|
|
37
|
-
if _main_dict["args"].gui_id:
|
|
38
|
-
gui.connect_to_gui_server(_main_dict["args"].gui_id)
|
|
68
|
+
if bec.started:
|
|
69
|
+
gui = bec.gui = _LazyBECGuiClient(gui_id=_main_dict["args"].gui_id)
|
|
39
70
|
if not _main_dict["args"].nogui:
|
|
40
|
-
|
|
71
|
+
try:
|
|
72
|
+
gui.show()
|
|
73
|
+
except ImportError:
|
|
74
|
+
logger.warning("BEC Widgets is not available")
|
|
75
|
+
pass
|
|
41
76
|
|
|
42
77
|
_available_plugins = plugin_helper.get_ipython_client_startup_plugins(state="post")
|
|
43
78
|
if _available_plugins:
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/beamline_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/live_table.py
RENAMED
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/callbacks/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/SLS/__init__.py
RENAMED
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/SLS/sls_info.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/bec_ipython_client/plugins/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_beamline_mixins.py
RENAMED
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_bec_client.py
RENAMED
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_device_progress.py
RENAMED
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_live_table.py
RENAMED
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_move_callback.py
RENAMED
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/client_tests/test_pretty_table.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/test_procedures_e2e.py
RENAMED
|
File without changes
|
|
File without changes
|
{bec_ipython_client-3.115.1 → bec_ipython_client-3.115.2}/tests/end-2-end/test_scans_lib_e2e.py
RENAMED
|
File without changes
|