mafw.steering.serializer

Serialize editable steering metadata into TOML documents via tomlkit.

Author:

Bulgheroni Antonio

Description:

Serialize steering configuration while preserving source TOML metadata.

Functions

serialize(builder, *[, validation_level])

Convert builder metadata into a TOML document matching the required layout.

mafw.steering.serializer._add_storage_configuration(doc: TOMLDocument, configuration: StorageConfiguration) → None[source]

Serialize configured storage volumes without resolving their roots.

mafw.steering.serializer._merge_table(target: Any, source: Any) → None[source]

Apply generated entries while retaining comments on matching TOML items.

mafw.steering.serializer._normalize_logical_op(value: str | LogicalOp) → LogicalOp | None[source]

Return the LogicalOp enum for the provided value when possible.

mafw.steering.serializer._serialize_condition(condition: Condition) → Any[source]

Convert Condition object to TOML-friendly value (implicit or dict).

mafw.steering.serializer._serialize_parameter_value(annotation: Any, value: Any) → Any[source]

Encode logical alternatives explicitly for supported path unions.

mafw.steering.serializer._storage_toml_value(value: Any) → Any[source]

Convert mappings recursively to TOML tables while preserving values.

mafw.steering.serializer._storage_volume_table(volume: StorageVolumeConfiguration) → Any[source]

Build one named-volume table, retaining invalid and unknown values.

mafw.steering.serializer.serialize(builder: SteeringBuilder, *, validation_level: ValidationLevel | None = None) → tomlkit.TOMLDocument[source]

Convert builder metadata into a TOML document matching the required layout.