angee.resources.sources
Registry of resource source types.
A resource entry names its source by a manifest key — path for a local file, url for a remote one. The resources addon owns the source-type seam but ships only the local path source; an addon that owns outbound networking, angee.integrate, contributes the url source through settings, so resources itself stays free of any network concern. Each source declares how to normalize its manifest value and how to materialize an entry to a local file.
ResourceSource
@dataclass(frozen=True, slots=True)
class ResourceSource()One resource source type, keyed by its manifest key (path/url).
key
The manifest key that selects this source in a resource declaration.
normalize
Return the stored source value from one raw manifest value.
materialize
Return the local file path for one entry, fetching/resolving as needed.
source_registry
def source_registry() -> dict[str, ResourceSource]Return resource source types declared by settings.
source_keys
def source_keys() -> frozenset[str]Return every configured source key.
get_source
def get_source(key: str) -> ResourceSourceReturn the configured source for key, or raise with an install hint.
path_source
def path_source() -> ResourceSourceReturn the built-in local-file resource source.
normalize_path
def normalize_path(app_config: AppConfig, value: object) -> strReturn one safe path relative to app_config.path.
materialize_path
def materialize_path(entry: ResourceEntry) -> PathMaterialize a local path source to its addon-relative file.