config

class mautrix.util.config.BaseConfig

Bases: abc.ABC, mautrix.util.config.RecursiveDict[ruamel.yaml.comments.CommentedMap]

abstract do_update(helper)
Parameters

helper (mautrix.util.config.ConfigUpdateHelper) –

Return type

None

abstract load()
Return type

None

load_and_update()
Return type

None

abstract load_base()
Return type

Optional[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]]

abstract save()
Return type

None

update(save=True)
Parameters

save (bool) –

Return type

None

exception mautrix.util.config.BaseMissingError

Bases: ValueError

class mautrix.util.config.ConfigUpdateHelper

Bases: object

__init__(base, config)
Parameters
Return type

None

copy(from_path, to_path=None)
Parameters
  • from_path (str) –

  • to_path (Optional[str]) –

Return type

None

copy_dict(from_path, to_path=None, override_existing_map=True)
Parameters
  • from_path (str) –

  • to_path (Optional[str]) –

  • override_existing_map (bool) –

Return type

None

base: RecursiveDict[CommentedMap]
class mautrix.util.config.BaseFileConfig

Bases: mautrix.util.config.BaseConfig, abc.ABC

__init__(path, base_path)
Parameters
  • path (str) –

  • base_path (str) –

Return type

None

load()
Return type

None

load_base()
Return type

Optional[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]]

save()
Return type

None

class mautrix.util.config.BaseProxyConfig

Bases: mautrix.util.config.BaseConfig, abc.ABC

__init__(load, load_base, save)
Parameters
  • load (Callable[[], ruamel.yaml.comments.CommentedMap]) –

  • load_base (Callable[[], Optional[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]]]) –

  • save (Callable[[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]], None]) –

Return type

None

load()
Return type

None

load_base()
Return type

Optional[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]]

save()
Return type

None

class mautrix.util.config.RecursiveDict

Bases: Generic[mautrix.util.config.recursive_dict.T]

__init__(data=None, dict_factory=None)
Parameters
  • data (Optional[mautrix.util.config.recursive_dict.T]) –

  • dict_factory (Optional[Type[mautrix.util.config.recursive_dict.T]]) –

Return type

None

clone()
Return type

mautrix.util.config.RecursiveDict

delete(key, allow_recursion=True)
Parameters
  • key (str) –

  • allow_recursion (bool) –

Return type

None

get(key, default_value, allow_recursion=True)
Parameters
  • key (str) –

  • default_value (Any) –

  • allow_recursion (bool) –

Return type

Any

static parse_key(key)
Parameters

key (str) –

Return type

tuple[str, str | None]

set(key, value, allow_recursion=True)
Parameters
  • key (str) –

  • value (Any) –

  • allow_recursion (bool) –

Return type

None

class mautrix.util.config.BaseStringConfig

Bases: mautrix.util.config.BaseConfig, abc.ABC

__init__(data, base_data)
Parameters
  • data (str) –

  • base_data (str) –

Return type

None

load()
Return type

None

load_base()
Return type

Optional[mautrix.util.config.recursive_dict.RecursiveDict[ruamel.yaml.comments.CommentedMap]]

save()
Return type

str

class mautrix.util.config.BaseValidatableConfig

Bases: mautrix.util.config.BaseConfig, abc.ABC

check_default_values()
Return type

None

abstract property forbidden_defaults: list[mautrix.util.config.ForbiddenDefault]
exception mautrix.util.config.ConfigValueError

Bases: ValueError

__init__(key, message)
Parameters
  • key (str) –

  • message (str) –

Return type

None

class mautrix.util.config.ForbiddenDefault

Bases: object

__init__(key, value, error=None, *, condition=None)

Method generated by attrs for class ForbiddenDefault.

Parameters
  • key (str) –

  • value (Any) –

  • error (Optional[str]) –

  • condition (Optional[str]) –

Return type

None

check(config)
Parameters

config (mautrix.util.config.BaseConfig) –

Return type

bool

property exception: mautrix.util.config.ConfigValueError
key: str
value: Any
error: str | None
condition: str | None
class mautrix.util.config.ForbiddenKey

Bases: str