Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/loader.py
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | class BasePackageInfo: | ||||
# The following attribute has kw_only=True in order to allow subclasses | # The following attribute has kw_only=True in order to allow subclasses | ||||
# to add attributes. Without kw_only, attributes without default values cannot | # to add attributes. Without kw_only, attributes without default values cannot | ||||
# go after attributes with default values. | # go after attributes with default values. | ||||
# See <https://github.com/python-attrs/attrs/issues/38> | # See <https://github.com/python-attrs/attrs/issues/38> | ||||
directory_extrinsic_metadata = attr.ib( | directory_extrinsic_metadata = attr.ib( | ||||
type=List[RawExtrinsicMetadataCore], default=[], kw_only=True, | type=List[RawExtrinsicMetadataCore], default=[], kw_only=True, | ||||
) | ) | ||||
""":term:`extrinsic metadata` collected by the loader, that will be attached to the | |||||
loaded directory and added to the Metadata storage.""" | |||||
# TODO: add support for metadata for directories and contents | # TODO: add support for metadata for revisions and contents | ||||
def extid(self) -> Optional[PartialExtID]: | def extid(self) -> Optional[PartialExtID]: | ||||
"""Returns a unique intrinsic identifier of this package info, | """Returns a unique intrinsic identifier of this package info, | ||||
or None if this package info is not 'deduplicatable' (meaning that | or None if this package info is not 'deduplicatable' (meaning that | ||||
we will always load it, instead of checking the ExtID storage | we will always load it, instead of checking the ExtID storage | ||||
to see if we already did)""" | to see if we already did)""" | ||||
if self.MANIFEST_FORMAT is None: | if self.MANIFEST_FORMAT is None: | ||||
return None | return None | ||||
▲ Show 20 Lines • Show All 901 Lines • Show Last 20 Lines |