betty.config.collections package

Submodules

Module contents

Define and provide collections of betty.config.Configuration instances.

class betty.config.collections.ConfigurationCollection[source]

Bases: Configuration, Generic[_ConfigurationKeyT, _ConfigurationT]

Any collection of betty.config.Configuration values.

To test your own subclasses, use betty.test_utils.config.collections.ConfigurationCollectionTestBase.

__init__(configurations: Iterable[_ConfigurationT] | None = None)[source]
abstractmethod append(*configurations: _ConfigurationT) None[source]

Append the given values to the end of the sequence.

clear() None[source]

Clear all items from the collection.

abstractmethod insert(index: int, *configurations: _ConfigurationT) None[source]

Insert the given values at the given index.

abstractmethod keys() Iterator[_ConfigurationKeyT][source]

Get all keys in this collection.

abstractmethod prepend(*configurations: _ConfigurationT) None[source]

Prepend the given values to the beginning of the sequence.

remove(*configuration_keys: _ConfigurationKeyT) None[source]

Remove the given keys from the collection.

abstractmethod replace(*configurations: _ConfigurationT) None[source]

Replace any existing values with the given ones.

abstractmethod values() Iterator[_ConfigurationT][source]

Get all values in this collection.