betty.app package¶
Submodules¶
Module contents¶
Define Betty’s core application functionality.
- final class betty.app.App[source]¶
Bases:
Configurable
[AppConfiguration
],TargetFactory
,CoreComponent
The Betty application.
- __init__(configuration: AppConfiguration, cache_directory_path: Path, *, cache_factory: Callable[[Self], Cache[Any]], fetcher: Fetcher | None = None)[source]¶
- property assets: AssetRepository¶
The assets file system.
- property binary_file_cache: BinaryFileCache¶
The binary file cache.
- property http_client: Awaitable[aiohttp.ClientSession]¶
The HTTP client.
- property localizers: LocalizerRepository¶
The available localizers.
- classmethod new_from_environment() AsyncIterator[Self] [source]¶
Create a new application from the environment.
- async new_target(cls: type[_T]) _T [source]¶
Create a new instance.
- Returns:
- If
cls
extendsbetty.app.factory.AppDependentFactory
, this will call returncls
’s new()
’s return value.
- If
- If
cls
extendsbetty.factory.IndependentFactory
, this will call returncls
’s new()
’s return value.
- If
Otherwise
cls()
will be called without arguments, and the resulting instance will be returned.
- Raises:
FactoryError – raised when
cls
could not be instantiated.
- classmethod new_temporary(*, fetcher: Fetcher | None = None) AsyncIterator[Self] [source]¶
Creat a new, temporary, isolated application.
The application will not use any persistent caches, or leave any traces on the system.
- property process_pool: Executor¶
The shared process pool.
Use this to run CPU/computationally-heavy tasks in other processes.
- property spdx_license_repository: Awaitable[PluginRepository[License]]¶
The SPDX licenses available to this application.