Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/archive.py
# Copyright (C) 2021 The Software Heritage developers | # Copyright (C) 2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from typing import Any, Dict, Iterable | from typing import Any, Dict, Iterable | ||||
from typing_extensions import Protocol, runtime_checkable | from typing_extensions import Protocol, runtime_checkable | ||||
from swh.model.model import Sha1Git | from swh.model.model import Sha1Git | ||||
from swh.storage.interface import StorageInterface | |||||
@runtime_checkable | @runtime_checkable | ||||
class ArchiveInterface(Protocol): | class ArchiveInterface(Protocol): | ||||
storage: StorageInterface | |||||
def directory_ls(self, id: Sha1Git) -> Iterable[Dict[str, Any]]: | def directory_ls(self, id: Sha1Git) -> Iterable[Dict[str, Any]]: | ||||
"""List entries for one directory. | """List entries for one directory. | ||||
Args: | Args: | ||||
id: sha1 id of the directory to list entries from. | id: sha1 id of the directory to list entries from. | ||||
Yields: | Yields: | ||||
dictionary of entries in such directory containing only the keys "name", | dictionary of entries in such directory containing only the keys "name", | ||||
Show All 29 Lines |