1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-05-05 06:16:32 +02:00

feat: add loader/helper for widget plugins

This commit is contained in:
2025-03-13 10:31:25 +01:00
parent b4925918f7
commit ca2bb4f9b4
19 changed files with 512 additions and 3671 deletions
+6 -1
View File
@@ -533,7 +533,12 @@ class BECGuiClient(RPCBase):
"""
name = state["name"]
gui_id = state["gui_id"]
widget_class = getattr(client, state["widget_class"])
try:
widget_class = getattr(client, state["widget_class"])
except AttributeError as e:
raise AttributeError(
f"Failed to find user widget {state['widget_class']} in the client - did you run bw-generate-cli to generate the plugin files?"
) from e
obj = self._ipython_registry.get(gui_id)
if obj is None:
widget = widget_class(gui_id=gui_id, name=name, parent=parent)