Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/metadata/base.py
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | def get_origin_metadata(self) -> List[RawExtrinsicMetadata]: | ||||
fetcher=self._metadata_fetcher(), | fetcher=self._metadata_fetcher(), | ||||
format=format_, | format=format_, | ||||
metadata=metadata_bytes, | metadata=metadata_bytes, | ||||
) | ) | ||||
) | ) | ||||
return self._origin_metadata_objects | return self._origin_metadata_objects | ||||
def get_parent_origins(self) -> List[Origin]: | |||||
"""If the given origin is a "forge fork" (ie. created with the "Fork" button | |||||
of GitHub-like forges), returns a list of origins it was forked from; | |||||
closest parent first.""" | |||||
raise NotImplementedError(f"{self.__class__.__name__}.get_parent_origins") | |||||
if TYPE_CHECKING: | if TYPE_CHECKING: | ||||
# Makes mypy check BaseMetadataFetcher follows the MetadataFetcherProtocol | # Makes mypy check BaseMetadataFetcher follows the MetadataFetcherProtocol | ||||
def _f() -> None: | def _f() -> None: | ||||
from swh.loader.core.metadata_fetchers import MetadataFetcherProtocol | from swh.loader.core.metadata_fetchers import MetadataFetcherProtocol | ||||
base_metadata_fetcher: Type[MetadataFetcherProtocol] | base_metadata_fetcher: Type[MetadataFetcherProtocol] | ||||
base_metadata_fetcher = BaseMetadataFetcher | base_metadata_fetcher = BaseMetadataFetcher | ||||
print(base_metadata_fetcher) | print(base_metadata_fetcher) | ||||
del _f | del _f |