betty.config.collections.sequence module¶
Define and provide sequences of betty.config.Configuration instances.
- class betty.config.collections.sequence.ConfigurationSequence[source]¶
Bases:
ConfigurationCollection[int,_ConfigurationT],Generic[_ConfigurationT]A sequence of configuration values.
- Parameters:
configurations (
typing.Optional[typing.Iterable[typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration)]])
- __init__(configurations: Iterable[betty.config.collections.sequence._ConfigurationT] | None = None)[source]¶
- Parameters:
configurations (
typing.Optional[typing.Iterable[typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration)]])
- append(*configurations: betty.config.collections.sequence._ConfigurationT) None[source]¶
Append the given values to the end of the sequence.
- Parameters:
configurations (
typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration))- Return type:
- dump() bool | int | float | str | None | Sequence[bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]] | Mapping[str, bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]] | type[betty.typing.Void][source]¶
Dump this instance to a portable format.
- Return type:
typing.Union[bool,int,float,str,None,typing.Sequence[typing.Union[bool,int,float,str,None,typing.Sequence[Dump],typing.Mapping[str, Dump]]],typing.Mapping[str,typing.Union[bool,int,float,str,None,typing.Sequence[Dump],typing.Mapping[str, Dump]]],type[betty.typing.Void]]
- insert(index: int, *configurations: betty.config.collections.sequence._ConfigurationT) None[source]¶
Insert the given values at the given index.
- Parameters:
index (
int)configurations (
typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration))
- Return type:
- load(dump: bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]) None[source]¶
Load dumped configuration.
- Raises:
betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.
- Parameters:
dump (
typing.Union[bool,int,float,str,None,typing.Sequence[Dump],typing.Mapping[str, Dump]])- Return type:
- move_to_beginning(*configuration_keys: int) None[source]¶
Move the given keys (and their values) to the beginning of the sequence.
- move_to_end(*configuration_keys: int) None[source]¶
Move the given keys (and their values) to the end of the sequence.
- move_towards_beginning(*configuration_keys: int) None[source]¶
Move the given keys (and their values) one place towards the beginning of the sequence.
- move_towards_end(*configuration_keys: int) None[source]¶
Move the given keys (and their values) one place towards the end of the sequence.
- prepend(*configurations: betty.config.collections.sequence._ConfigurationT) None[source]¶
Prepend the given values to the beginning of the sequence.
- Parameters:
configurations (
typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration))- Return type:
- replace(*values: betty.config.collections.sequence._ConfigurationT) None[source]¶
Replace any existing values with the given ones.
- Parameters:
values (
typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration))- Return type:
- update(other: Self) None[source]¶
Update this configuration with the values from
other.- Parameters:
other (
typing.Self)- Return type:
- values() Iterator[betty.config.collections.sequence._ConfigurationT][source]¶
Get all values in this collection.
- Return type:
typing.Iterator[typing.TypeVar(_ConfigurationT, bound=betty.config.Configuration)]