bec_widgets.cli.rpc.rpc_base ============================ .. py:module:: bec_widgets.cli.rpc.rpc_base Attributes ---------- .. autoapisummary:: bec_widgets.cli.rpc.rpc_base.client Exceptions ---------- .. autoapisummary:: bec_widgets.cli.rpc.rpc_base.DeletedWidgetError bec_widgets.cli.rpc.rpc_base.RPCResponseTimeoutError Classes ------- .. autoapisummary:: bec_widgets.cli.rpc.rpc_base.RPCBase bec_widgets.cli.rpc.rpc_base.RPCReference Functions --------- .. autoapisummary:: bec_widgets.cli.rpc.rpc_base._name_arg bec_widgets.cli.rpc.rpc_base._transform_args_kwargs bec_widgets.cli.rpc.rpc_base.check_for_deleted_widget bec_widgets.cli.rpc.rpc_base.rpc_call bec_widgets.cli.rpc.rpc_base.rpc_timeout Module Contents --------------- .. py:exception:: DeletedWidgetError Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. Initialize self. See help(type(self)) for accurate signature. .. py:exception:: RPCResponseTimeoutError(request_id, timeout) Bases: :py:obj:`Exception` Exception raised when an RPC response is not received within the expected time. Initialize self. See help(type(self)) for accurate signature. .. py:class:: RPCBase(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) .. py:method:: __repr__() .. py:method:: _create_widget_from_msg_result(msg_result) .. py:method:: _gui_is_alive() Check if the GUI is alive. .. py:method:: _on_rpc_response(msg_obj: bec_lib.connector.MessageObject, parent: RPCBase) -> None :staticmethod: .. py:method:: _refresh_references() Refresh the references. .. py:method:: _run_rpc(method, *args, wait_for_rpc_response=True, timeout=5, gui_id: str | None = None, **kwargs) -> Any Run the RPC call. :param method: The method to call. :param args: The arguments to pass to the method. :param wait_for_rpc_response: Whether to wait for the RPC response. :param timeout: The timeout for the RPC response. :param gui_id: The GUI ID to use for the RPC call. If None, the default GUI ID is used. :param kwargs: The keyword arguments to pass to the method. :returns: The result of the RPC call. .. py:method:: raise_window() Bring this widget (or its container) to the front. .. py:method:: remove() Remove the widget. .. py:property:: _root :type: bec_widgets.cli.client_utils.BECGuiClient Get the root widget. This is the BECFigure widget that holds the anchor gui_id. .. py:attribute:: object_name :value: None .. py:class:: RPCReference(registry: dict, gui_id: str) .. py:method:: __dir__() .. py:method:: __getattr__(name) .. py:method:: __repr__() .. py:method:: __setattr__(name, value) .. py:method:: __str__() .. py:method:: _is_deleted() -> bool .. py:attribute:: object_name .. py:function:: _name_arg(arg) .. py:function:: _transform_args_kwargs(args, kwargs) -> tuple[tuple, dict] .. py:function:: check_for_deleted_widget(func) .. py:function:: rpc_call(func) A decorator for calling a function on the server. :param func: The function to call. :returns: The result of the function call. .. py:function:: rpc_timeout(timeout) A decorator to set a timeout for an RPC call. :param timeout: The timeout in seconds. :returns: The decorated function. .. py:data:: client