Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/algos/directory.py
- This file was moved from swh/provenance/directory.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 | ||||
import os | import os | ||||
from typing import Generator, Iterable, Iterator, List, Optional | from typing import Generator, Iterable, Iterator, List, Optional | ||||
from swh.core.statsd import statsd | from swh.core.statsd import statsd | ||||
from swh.model.model import Sha1Git | from swh.model.model import Sha1Git | ||||
from swh.provenance.archive import ArchiveInterface | |||||
from .archive import ArchiveInterface | from swh.provenance.interface import ProvenanceInterface | ||||
from .interface import ProvenanceInterface | from swh.provenance.model import DirectoryEntry | ||||
from .model import DirectoryEntry | |||||
REVISION_DURATION_METRIC = "swh_provenance_directory_duration_seconds" | REVISION_DURATION_METRIC = "swh_provenance_directory_duration_seconds" | ||||
class CSVDirectoryIterator: | class CSVDirectoryIterator: | ||||
"""Iterator over directories typically present in the given CSV file. | """Iterator over directories typically present in the given CSV file. | ||||
The input is an iterator that produces ids (sha1_git) of directories | The input is an iterator that produces ids (sha1_git) of directories | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |