Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/revision.py
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | class CSVRevisionIterator: | ||||
def __next__(self): | def __next__(self): | ||||
with self.mutex: | with self.mutex: | ||||
id, date, root = next(self.revisions) | id, date, root = next(self.revisions) | ||||
date = iso8601.parse_date(date) | date = iso8601.parse_date(date) | ||||
if date.tzinfo is None: | if date.tzinfo is None: | ||||
date = date.replace(tzinfo=timezone.utc) | date = date.replace(tzinfo=timezone.utc) | ||||
return RevisionEntry( | return RevisionEntry( | ||||
hash_to_bytes(id), date=date, root=hash_to_bytes(root), | hash_to_bytes(id), | ||||
date=date, | |||||
root=hash_to_bytes(root), | |||||
) | ) | ||||
# class ArchiveRevisionIterator(RevisionIterator): | # class ArchiveRevisionIterator(RevisionIterator): | ||||
# """Iterator over revisions present in the given database.""" | # """Iterator over revisions present in the given database.""" | ||||
# | # | ||||
# def __init__(self, conn, limit=None, chunksize=100): | # def __init__(self, conn, limit=None, chunksize=100): | ||||
# self.cur = conn.cursor() | # self.cur = conn.cursor() | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |