Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/nixguix/loader.py
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | class NixGuixLoader(PackageLoader[NixGuixPackageInfo]): | ||||
def get_metadata_authority(self): | def get_metadata_authority(self): | ||||
return MetadataAuthority( | return MetadataAuthority( | ||||
type=MetadataAuthorityType.FORGE, url=self.url, metadata={}, | type=MetadataAuthorityType.FORGE, url=self.url, metadata={}, | ||||
) | ) | ||||
def get_extrinsic_snapshot_metadata(self): | def get_extrinsic_snapshot_metadata(self): | ||||
return [ | return [ | ||||
RawExtrinsicMetadataCore( | RawExtrinsicMetadataCore( | ||||
format="nixguix-sources-json", | format="nixguix-sources-json", metadata=self.raw_sources, | ||||
metadata=self.raw_sources, | |||||
discovery_date=None, | |||||
), | ), | ||||
] | ] | ||||
# Note: this could be renamed get_artifact_info in the PackageLoader | # Note: this could be renamed get_artifact_info in the PackageLoader | ||||
# base class. | # base class. | ||||
def get_package_info(self, url) -> Iterator[Tuple[str, NixGuixPackageInfo]]: | def get_package_info(self, url) -> Iterator[Tuple[str, NixGuixPackageInfo]]: | ||||
# TODO: try all mirrors and not only the first one. A source | # TODO: try all mirrors and not only the first one. A source | ||||
# can be fetched from several urls, called mirrors. We | # can be fetched from several urls, called mirrors. We | ||||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |