:py:mod:`mloq.record` ===================== .. py:module:: mloq.record .. autoapi-nested-parse:: This module contains the classes that keep track of the internal state of the application when running a Command. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: mloq.record.Ledger mloq.record.CMDRecord .. py:class:: Ledger Keep track of the generated files. .. py:method:: files() :property: Return the list of generated file names. .. py:method:: register(file, description = None) Append another generated file to the book. .. py:class:: CMDRecord(config = None, files = None, directories = None) Keep track of files and directories that will be created by mloq. The :class:`CMDRecord` acts as a single source of truth for storing the files and directories generated by `mloq` as well as the necessary configuration to generate them. This class registers three separate data sources: - `config`: An :class:`omegaconf.DictConfig` that contains the configuration of all the commands executed by `mloq`. - `files`: A `dict` containing the content and location of the files generated by mloq. It is indexed by :class:`Path` objects that indicate where the file will be created, and its values are instances of :class:`mloq.files.File`. - `directories`: List of :class:`Path` instances pointing to the different directories that `mloq` will create. This class is initialized from a configuration dictionary. The dictionary can be either an :class:`omegaconf.DictConfig` or an empty dictionary. .. py:method:: config() :property: Store the configuration parameters that govern the project's structure. It contains one configuration entry per each :class:`Command` that will be run, and each entry will only be modified by the :class:`Command` it represents. Each :class:`Command` instance is responsible for updating its corresponding `config` values. :returns: :class:`omegaconf.DictConfig` that contains the configuration of all the commands executed by `mloq`. .. py:method:: files() :property: Return the dictionary of files used by mloq to generate the project configuration. `files` is a `dict` containing the content and location of the files generated by mloq. It is indexed by :class:`Path` objects that indicate where the file will be created, and its values are instances of :class:`mloq.files.File`. Each different :class:`Command` is responsible for registering the files it generates to the `files` dictionary. .. py:method:: directories() :property: Contain the folders that will be created by mloq for storing the project's files. .. py:method:: update_config(config) Update the configuration attribute according to the values entered by the user. .. py:method:: register_file(file, path, description = None) Append a new file to the 'files' container. Keys are Path strings describing the location where the file will be created. Values are File objects containing the information of the file that will be generated. .. py:method:: register_directory(path) Append a new directory path to the 'directories' container.