:py:mod:`anod.loader` ===================== .. py:module:: anod.loader .. autoapi-nested-parse:: Anod specification loader. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anod.loader.SpecConfig anod.loader.AnodSpecRepository anod.loader.AnodModule Functions ~~~~~~~~~ .. autoapisummary:: anod.loader.spec Attributes ~~~~~~~~~~ .. autoapisummary:: anod.loader.logger .. py:data:: logger .. py:class:: SpecConfig Contain specification files configuration. :ivar spec_dir: path to the anod specs :ivar repositories: dict containing the list of repositories metadata (content of config/repositories) .. py:class:: AnodSpecRepository(spec_dir: str, spec_config: Any = None, extra_repositories_config: dict | None = None) Anod spec repository. :ivar specs: A dictionary of AnodModule objects, indexed by spec name (without the spec filename's extension). :vartype specs: dict[e3.anod.loader.AnodModule] The object represent a set of anod specifications along with their data files. .. py:method:: __contains__(item: str) -> bool Check by name if a spec is present in the repository. :param item: the spec name to check :return: True if present, False otherwise .. py:method:: load_all(ignore_errors: bool = False) -> None Load all the specs present in the repository. :param ignore_errors: if True don't stop on error. .. py:method:: load(name: str) -> collections.abc.Callable[Ellipsis, e3.anod.spec.Anod] Load an anod spec and return the corresponding Anod class. :param name: name of the spec to load .. py:class:: AnodModule(name: str, path: str, data: list[str]) Represent a loaded Anod specification module. .. py:property:: is_loaded :type: bool Check if a spec is already loaded. :return: True if the spec is already loaded, False otherwise .. py:method:: load(repository: AnodSpecRepository) -> collections.abc.Callable[Ellipsis, e3.anod.spec.Anod] Load an anod specification and return the corresponding Anod class. :param repository: the anod spec repository of the spec file :raise SandBoxError: in case of failure .. py:function:: spec(name: str) -> collections.abc.Callable[Ellipsis, e3.anod.spec.Anod] Load an Anod spec class. Obsolete: keep until all from e3.anod.loader import spec are removed from the specs. Note that two spec having the same name cannot be loaded in the same process as e3 keeps a cache of loaded spec using the spec basename as a key. :param name: name of the spec to load