enconsole.conso package#

Subpackages#

Submodules#

enconsole.conso.config module#

class enconsole.conso.config.ConsoConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | list[str] | list[Path] | tuple[str | Path, ...] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#

Bases: Config

Contain the configurations from the arguments and files.

Parameters:
  • sargs – Additional arguments on the command line.

  • files – Complete or relative path to config files.

  • cargs – Configuration arguments in dictionary form, which will override contents from the config files.

property params: ConsoParams#

Return the Pydantic model containing the configuration.

Warning

This method completely overrides the parent but is based on that code, would be unfortunate if upstream changes meant this breaks or breaks something else.

Returns:

Pydantic model containing the configuration.

merge_params() None[source]#

Update the Pydantic model containing the configuration.

enconsole.conso.conso module#

class enconsole.conso.conso.Conso(config: ConsoConfig)[source]#

Bases: object

Interact with supported devices to ensure desired state.

Parameters:

config – Primary class instance for configuration.

property config: ConsoConfig#

Return the Config instance containing the configuration.

Returns:

Config instance containing the configuration.

property params: ConsoParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property console: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property debug: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dryrun: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property forced: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

enconsole.conso.models module#

class enconsole.conso.models.ConsoModels[source]#

Bases: object

Return the class object that was imported within method.

classmethod conso() type[ConsoParams][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.

Module contents#

class enconsole.conso.Conso(config: ConsoConfig)[source]#

Bases: object

Interact with supported devices to ensure desired state.

Parameters:

config – Primary class instance for configuration.

property config: ConsoConfig#

Return the Config instance containing the configuration.

Returns:

Config instance containing the configuration.

property params: ConsoParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property console: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property debug: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dryrun: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property forced: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

class enconsole.conso.ConsoConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | list[str] | list[Path] | tuple[str | Path, ...] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#

Bases: Config

Contain the configurations from the arguments and files.

Parameters:
  • sargs – Additional arguments on the command line.

  • files – Complete or relative path to config files.

  • cargs – Configuration arguments in dictionary form, which will override contents from the config files.

property params: ConsoParams#

Return the Pydantic model containing the configuration.

Warning

This method completely overrides the parent but is based on that code, would be unfortunate if upstream changes meant this breaks or breaks something else.

Returns:

Pydantic model containing the configuration.

merge_params() None[source]#

Update the Pydantic model containing the configuration.

class enconsole.conso.ConsoModels[source]#

Bases: object

Return the class object that was imported within method.

classmethod conso() type[ConsoParams][source]#

Return the class object that was imported within method.

Returns:

Class object that was imported within method.