bec_widgets.cli.generate_cli ============================ .. py:module:: bec_widgets.cli.generate_cli Classes ------- .. autoapisummary:: bec_widgets.cli.generate_cli.ClientGenerator Functions --------- .. autoapisummary:: bec_widgets.cli.generate_cli.get_overloads bec_widgets.cli.generate_cli.main Module Contents --------------- .. py:class:: ClientGenerator(base=False) .. py:method:: _get_user_access_entries(cls) -> list[str] :staticmethod: .. py:method:: _resolve_method_object(cls, method_entry: str) :staticmethod: .. py:method:: _rpc_call(timeout_info: dict[str, float | None]) Decorator to mark a method as an RPC call. This is used to generate the client code for the method. .. py:method:: generate_client(class_container: bec_widgets.utils.plugin_utils.BECClassContainer) Generate the client for the published classes, skipping any classes that have `RPC = False`. :param class_container: The class container with the classes to generate the client for. .. py:method:: generate_content_for_class(cls) Generate the content for the class. :param cls: The class for which to generate the content. .. py:method:: write(file_name: str) Write the content to a file, automatically formatted with black. :param file_name: The name of the file to write to. :type file_name: str .. py:method:: write_client_enum(published_classes: list[type]) Write the client enum to the content. .. py:attribute:: content :value: '' .. py:attribute:: header :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """# This file was automatically generated by generate_cli.py # type: ignore from __future__ import annotations from bec_lib.logger import bec_logger from bec_widgets.cli.rpc.rpc_base import RPCBase, rpc_call, rpc_timeout logger = bec_logger.logger # pylint: skip-file""" .. raw:: html
.. py:function:: get_overloads(_obj) Dummy function for Python versions before 3.11. .. py:function:: main() Main entry point for the script, controlled by command line arguments.