betty.extension.gramps.config module - Betty 0.4.0a3 documentation

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

# betty.extension.gramps.config module

Provide configuration for the `betty.extension.Gramps` extension.

class betty.extension.gramps.config.FamilyTreeConfiguration

  Bases: `Configuration`

  Configure a single Gramps family tree.

  Parameters:

    file_path (`pathlib.Path`)

  __init__(file_path: pathlib.Path)
    Parameters:

      file_path (`pathlib.Path`)

  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]

    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`]]

  property file_path: Path | None

    The path to the Gramps family tree file.

  load(dump: bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]) → None

    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:

      `None`

  update(other: Self) → None

    Update this configuration with the values from `other`.

    Parameters:

      other (`typing.Self`)

    Return type:

      `None`

class betty.extension.gramps.config.FamilyTreeConfigurationSequence

  Bases: `ConfigurationSequence`[`FamilyTreeConfiguration`]

  Configure zero or more Gramps family trees.

  Parameters:

    configurations (`typing.Optional`[`typing.Iterable`[`typing.TypeVar`(`_ConfigurationT`, bound= `betty.config.Configuration`)]])

  load_item(dump: bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]) → betty.extension.gramps.config.FamilyTreeConfiguration

    Create and load a new item from the given dump, or raise an assertion error.

    Raises:

      betty.assertion.error.AssertionFailed – Raised when the dump is invalid and cannot be loaded.

    Parameters:

      dump (`typing.Union`[`bool`, `int`, `float`, `str`, `None`, `typing.Sequence`[Dump], `typing.Mapping`[`str`, Dump]])

    Return type:

      `betty.extension.gramps.config.FamilyTreeConfiguration`

class betty.extension.gramps.config.GrampsConfiguration

  Bases: `Configuration`

  Provide configuration for the `betty.extension.gramps.Gramps` extension.

  Parameters:

    family_trees (`typing.Optional`[`typing.Iterable`[`betty.extension.gramps.config.FamilyTreeConfiguration`]])

  __init__(*, family_trees: Iterable[betty.extension.gramps.config.FamilyTreeConfiguration] | None = None)
    Parameters:

      family_trees (`typing.Optional`[`typing.Iterable`[`betty.extension.gramps.config.FamilyTreeConfiguration`]])

  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]

    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`]]

  property family_trees: FamilyTreeConfigurationSequence

    The Gramps family trees to load.

  load(dump: bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]) → None

    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:

      `None`

  update(other: Self) → None

    Update this configuration with the values from `other`.

    Parameters:

      other (`typing.Self`)

    Return type:

      `None`