Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/archive.py
Show First 20 Lines • Show All 1,400 Lines • ▼ Show 20 Lines | def lookup_object(object_type: ObjectType, object_id: str) -> Dict[str, Any]: | ||||
elif object_type == ObjectType.REVISION: | elif object_type == ObjectType.REVISION: | ||||
return lookup_revision(object_id) | return lookup_revision(object_id) | ||||
elif object_type == ObjectType.SNAPSHOT: | elif object_type == ObjectType.SNAPSHOT: | ||||
return lookup_snapshot(object_id) | return lookup_snapshot(object_id) | ||||
else: | else: | ||||
raise ValueError(f"Unexpected object type variant: {object_type}") | raise ValueError(f"Unexpected object type variant: {object_type}") | ||||
def lookup_missing_hashes(grouped_swhids: Dict[str, List[bytes]]) -> Set[str]: | def lookup_missing_hashes(grouped_swhids: Dict[ObjectType, List[bytes]]) -> Set[str]: | ||||
"""Lookup missing Software Heritage persistent identifier hash, using | """Lookup missing Software Heritage persistent identifier hash, using | ||||
batch processing. | batch processing. | ||||
Args: | Args: | ||||
A dictionary with: | A dictionary with: | ||||
keys: object types | keys: object types | ||||
values: object hashes | values: object hashes | ||||
Returns: | Returns: | ||||
Show All 36 Lines |