Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/loader.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | SWH_METADATA_AUTHORITY = MetadataAuthority( | ||||
metadata={}, | metadata={}, | ||||
) | ) | ||||
"""Metadata authority for extrinsic metadata generated by Software Heritage. | """Metadata authority for extrinsic metadata generated by Software Heritage. | ||||
Used for metadata on "original artifacts", ie. length, filename, and checksums | Used for metadata on "original artifacts", ie. length, filename, and checksums | ||||
of downloaded archive files.""" | of downloaded archive files.""" | ||||
PartialExtID = Tuple[str, bytes] | PartialExtID = Tuple[str, bytes] | ||||
"""The ``extid_type`` and ``extid`` fields of an :ref:py:`ExtID` object.""" | """The ``extid_type`` and ``extid`` fields of an :class:`ExtID` object.""" | ||||
@attr.s | @attr.s | ||||
class RawExtrinsicMetadataCore: | class RawExtrinsicMetadataCore: | ||||
"""Contains the core of the metadata extracted by a loader, that will be | """Contains the core of the metadata extracted by a loader, that will be | ||||
used to build a full RawExtrinsicMetadata object by adding object identifier, | used to build a full RawExtrinsicMetadata object by adding object identifier, | ||||
context, and provenance information.""" | context, and provenance information.""" | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | ): | ||||
super().__init__(storage=storage, max_content_size=max_content_size) | super().__init__(storage=storage, max_content_size=max_content_size) | ||||
self.url = url | self.url = url | ||||
self.visit_date = datetime.datetime.now(tz=datetime.timezone.utc) | self.visit_date = datetime.datetime.now(tz=datetime.timezone.utc) | ||||
def get_versions(self) -> Sequence[str]: | def get_versions(self) -> Sequence[str]: | ||||
"""Return the list of all published package versions. | """Return the list of all published package versions. | ||||
Raises: | Raises: | ||||
`class:swh.loader.exception.NotFound` error when failing to read the | class:`swh.loader.exception.NotFound` error when failing to read the | ||||
published package versions. | published package versions. | ||||
Returns: | Returns: | ||||
Sequence of published versions | Sequence of published versions | ||||
""" | """ | ||||
return [] | return [] | ||||
▲ Show 20 Lines • Show All 796 Lines • Show Last 20 Lines |