betty.project package¶
Subpackages¶
Submodules¶
- betty.project.config module
DEFAULT_LIFETIME_THRESHOLD
EntityReference
EntityReferenceSequence
EntityTypeConfiguration
EntityTypeConfigurationMapping
EventTypeConfigurationMapping
ExtensionConfiguration
ExtensionConfigurationMapping
LocaleConfiguration
LocaleConfigurationMapping
ProjectConfiguration
ProjectConfiguration.__init__()
ProjectConfiguration.assets_directory_path
ProjectConfiguration.author
ProjectConfiguration.base_url
ProjectConfiguration.clean_urls
ProjectConfiguration.configuration_file_path
ProjectConfiguration.debug
ProjectConfiguration.dump()
ProjectConfiguration.entity_types
ProjectConfiguration.event_types
ProjectConfiguration.extensions
ProjectConfiguration.lifetime_threshold
ProjectConfiguration.load()
ProjectConfiguration.locales
ProjectConfiguration.localize_www_directory_path()
ProjectConfiguration.logo
ProjectConfiguration.name
ProjectConfiguration.output_directory_path
ProjectConfiguration.project_directory_path
ProjectConfiguration.root_path
ProjectConfiguration.title
ProjectConfiguration.update()
ProjectConfiguration.url
ProjectConfiguration.www_directory_path
- betty.project.factory module
Module contents¶
Provide the project API.
Projects are how people use Betty. A project is a workspace, starting out with the user’s configuration, and combining it with the resulting ancestry, allowing the user to perform tasks, such as generating a site from the entire project.
- final class betty.project.Project[source]¶
Bases:
Configurable
[ProjectConfiguration
],DependentFactory
[Any
],CoreComponent
Define a Betty project.
A project combines project configuration and the resulting ancestry.
- __init__(app: App, configuration: ProjectConfiguration, *, ancestry: Ancestry | None = None)[source]¶
- property assets: AssetRepository¶
The assets file system.
- property event_dispatcher: EventDispatcher¶
The event dispatcher.
- property event_types: PluginRepository[EventType]¶
The event types available to this project.
- property extensions: ProjectExtensions¶
The enabled extensions.
- property jinja2_environment: Environment¶
The Jinja2 environment.
- property localizers: LocalizerRepository¶
The available localizers.
- property name: str¶
The project name.
If no project name was configured, this defaults to the hash of the configuration file path.
- async new(cls: type[Any]) Any [source]¶
Create a new instance.
- Raises:
FactoryError – raised when the class could not be instantiated.
- classmethod new_temporary(app: App, *, ancestry: Ancestry | None = None) AsyncIterator[Self] [source]¶
Creat a new, temporary, isolated project.
The project will not leave any traces on the system, except when it uses global Betty functionality such as caches.
- property static_url_generator: StaticUrlGenerator¶
The static URL generator.
- property url_generator: LocalizedUrlGenerator¶
The (localized) URL generator.
- class betty.project.ProjectEvent[source]¶
Bases:
Event
An event that is dispatched within the context of a
betty.project.Project
.- __init__(job_context: ProjectContext)[source]¶
- property job_context: ProjectContext¶
The site generation job context.
- property project: Project¶
The
betty.project.Project
this event is dispatched within.
- final class betty.project.ProjectExtensions[source]¶
Bases:
object
Manage the extensions running within the
betty.project.Project
.This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.