betty.app package

Subpackages

Module contents

Define Betty’s core application functionality.

final class betty.app.App(configuration=None, project=None)[source]

Bases: Configurable[AppConfiguration]

Parameters:
configuration=None

project=None

property assets : FileSystem
property cache : FileCache
discover_extension_types()[source]
Return type:

set[type[betty.app.extension.Extension]]

property dispatcher : Dispatcher
property entity_types : set[type[Entity]]
property event_types : set[type[EventType]]
property extensions : Extensions
property http_client : ClientSession
property jinja2_environment : Environment
property localizer : Localizer

Get the application’s localizer.

property localizers : LocalizerRepository
property project : Project
property renderer : Renderer
property servers : Mapping[str, Server]
async start()[source]
Return type:

None

property static_url_generator : StaticUrlGenerator
async stop()[source]
Return type:

None

property url_generator : LocalizedUrlGenerator
class betty.app.AppConfiguration(*, locale=None)[source]

Bases: FileBasedConfiguration

Parameters:
locale=None

property configuration_file_path : Path
dump()[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.serde.dump.Void]]

classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

property locale : str | None
update(other)[source]
Parameters:
other

Return type:

None