rcmpy.config package#

Submodules#

rcmpy.config.file module#

A module implementing an interface for package-managed files.

class rcmpy.config.file.ManagedFile(template: str, extra_templates: Set[str], directory: Path, name: str, link: bool, executable: bool, condition: str, platforms: Set[str])[source]#

Bases: object

A data structure for managed files specified in the configuration data.

condition: str#
directory: Path#
evaluate(env: Dict[str, Any]) bool[source]#

Determine if this file should be handled.

executable: bool#
extra_templates: Set[str]#
name: str#
property output: Path#

Get the full output path.

property platform: bool#

Determine if the platform is correct for handling this file.

platforms: Set[str]#
property present: bool#

Determine if this file is currently present in the file system.

template: str#
update(source: Path, logger: Logger | LoggerAdapter[Any]) None[source]#

Update this managed file based on the provided source file.

update_root(root: Path) None[source]#

If the output directory is a relative path, update it to be an absolute one based on the provided root directory.

Module contents#

A module implementing a configuration interface for the package.

class rcmpy.config.Config(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#

Bases: RcmpyDictCodec, BasicDictCodec

The top-level configuration object for the package.

init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None[source]#

Initialize this instance.

update_root(root: Path) None[source]#

Call ‘update_root’ for each managed file.

class rcmpy.config.ManagedFile(template: str, extra_templates: Set[str], directory: Path, name: str, link: bool, executable: bool, condition: str, platforms: Set[str])[source]#

Bases: object

A data structure for managed files specified in the configuration data.

condition: str#
directory: Path#
evaluate(env: Dict[str, Any]) bool[source]#

Determine if this file should be handled.

executable: bool#
extra_templates: Set[str]#
name: str#
property output: Path#

Get the full output path.

property platform: bool#

Determine if the platform is correct for handling this file.

platforms: Set[str]#
property present: bool#

Determine if this file is currently present in the file system.

template: str#
update(source: Path, logger: Logger | LoggerAdapter[Any]) None[source]#

Update this managed file based on the provided source file.

update_root(root: Path) None[source]#

If the output directory is a relative path, update it to be an absolute one based on the provided root directory.