betty.config.collections.mapping module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.config.collections.mapping module

Define and provide key-value mappings of `betty.config.Configuration` instances.

class betty.config.collections.mapping.ConfigurationMapping

  Bases: `_ConfigurationMapping`[`_ConfigurationKeyT`, `_ConfigurationT`], `Generic`[`_ConfigurationKeyT`, `_ConfigurationT`]

  A key-value mapping where values are `betty.config.Configuration`.

  To test your own subclasses, use `betty.test_utils.config.collections.mapping.ConfigurationMappingTestBase`.

  dump() → DumpMapping[Dump]

    Produce a serialized data dump of `self`.

  load(dump: Dump) → None

    Load a serialized data dump into `self`.

    Raises:

      betty.assertion.error.AssertionFailed – Raised if the dump is invalid.

class betty.config.collections.mapping.OrderedConfigurationMapping

  Bases: `_ConfigurationMapping`[`_ConfigurationKeyT`, `_ConfigurationT`], `Generic`[`_ConfigurationKeyT`, `_ConfigurationT`]

  An ordered key-value mapping where values are `betty.config.Configuration`.

  To test your own subclasses, use `betty.test_utils.config.collections.mapping.OrderedConfigurationMappingTestBase`.

  dump() → DumpSequence[Dump]

    Produce a serialized data dump of `self`.

  load(dump: Dump) → None

    Load a serialized data dump into `self`.

    Raises:

      betty.assertion.error.AssertionFailed – Raised if the dump is invalid.