betty.app package

Subpackages

Module contents

Define Betty’s core application functionality.

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

Bases: Configurable[AppConfiguration]

Parameters:
configuration=None

project=None

cache_directory_path=None

property assets : FileSystem
property binary_file_cache : BinaryFileCache
property cache : Cache[typing.Any] & 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
classmethod new_from_app(cls, app, *, project=None)[source]
Parameters:
app

project=None

Return type:

collections.abc.AsyncIterator[typing.Self]

classmethod new_from_environment(cls, *, project=None)[source]
Parameters:
project=None

Return type:

collections.abc.AsyncIterator[typing.Self]

classmethod new_temporary(cls, *, project=None)[source]
Parameters:
project=None

Return type:

collections.abc.AsyncIterator[typing.Self]

property process_pool : Executor
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(configuration_directory_path=None, *, locale=None)[source]

Bases: FileBasedConfiguration

Parameters:
configuration_directory_path=None

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