ifgen package#

Subpackages#

Submodules#

ifgen.app module#

This package’s command-line entry-point application.

ifgen.app.add_app_args(parser: ArgumentParser) None[source]#

Add application-specific arguments to the command-line parser.

ifgen.app.entry(args: Namespace) int[source]#

Execute the requested task.

ifgen.entry module#

This package’s command-line entry-point (boilerplate).

ifgen.entry.main(argv: list[str] = None) int[source]#

Program entry-point.

ifgen.enums module#

A module implementing enumerations used by this package.

class ifgen.enums.Generator(*values)[source]#

Bases: StrEnum

An enumeration declaring all valid kinds of generators.

CUSTOM = 'custom'#
ENUMS = 'enums'#
IFGEN = 'ifgen'#
STRUCTS = 'structs'#
class ifgen.enums.Language(*values)[source]#

Bases: StrEnum

An enumeration declaring output generation variants.

CPP = 'CPP'#
PYTHON = 'Python'#
property cfg_dir_name: str#

Get the configuration key for this language’s output configuration.

property header_suffix: str#

Get a header-file suffix for this language.

property slug: str#

Get a slug string.

property source_suffix: str#

Get a source-file suffix for this language.

ifgen.paths module#

A module exposing some pathing utilities.

ifgen.paths.audit_init_file(source: Path, parent_depth: int = 0) None[source]#

Create initialization files if necessary.

ifgen.paths.combine_if_not_absolute(root: Path, candidate: Path | str | None) Path[source]#

Combine a root directory with a path if the path isn’t absolute.

ifgen.paths.create_formatter(*args: str, **kwargs) Callable[[str], str][source]#

Create a formatting preprocessor that uses stdin/stdout of a subprocess.

ifgen.schemas module#

A module for working with schemas belonging to this package.

class ifgen.schemas.IfgenDictCodec(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: DictCodec

A simple wrapper for package classes that want to implement DictCodec.

data: dict[str, Any]#
default_schemas: SchemaMap | None = {'SvdConfig': <vcorelib.schemas.json.JsonSchema object>, 'Config': <vcorelib.schemas.json.JsonSchema object>, 'has_json_indent': <vcorelib.schemas.json.JsonSchema object>, 'has_bit_fields': <vcorelib.schemas.json.JsonSchema object>, 'has_volatile': <vcorelib.schemas.json.JsonSchema object>, 'has_description': <vcorelib.schemas.json.JsonSchema object>, 'BitField': <vcorelib.schemas.json.JsonSchema object>, 'StructField': <vcorelib.schemas.json.JsonSchema object>, 'has_expected_size': <vcorelib.schemas.json.JsonSchema object>, 'SvdInstanceConfig': <vcorelib.schemas.json.JsonSchema object>, 'has_namespace': <vcorelib.schemas.json.JsonSchema object>, 'StructFieldAlternate': <vcorelib.schemas.json.JsonSchema object>, 'StructInstance': <vcorelib.schemas.json.JsonSchema object>, 'Enum': <vcorelib.schemas.json.JsonSchema object>, 'Struct': <vcorelib.schemas.json.JsonSchema object>}#

Module contents#

Useful defaults and other package metadata.