Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/converters.py
# Copyright (C) 2015-2021 The Software Heritage developers | # Copyright (C) 2015-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 Affero General Public License version 3, or any later version | # License: GNU Affero 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 datetime | import datetime | ||||
import json | import json | ||||
from typing import Any, Dict, Union | from typing import Any, Dict, Union | ||||
from django.core.serializers.json import DjangoJSONEncoder | from django.core.serializers.json import DjangoJSONEncoder | ||||
from swh.core.utils import decode_with_escape | from swh.core.utils import decode_with_escape | ||||
from swh.model import hashutil | from swh.model import hashutil | ||||
from swh.model.identifiers import ObjectType | |||||
from swh.model.model import RawExtrinsicMetadata, Release, Revision | from swh.model.model import RawExtrinsicMetadata, Release, Revision | ||||
from swh.model.swhids import ObjectType | |||||
from swh.storage.interface import PartialBranches | from swh.storage.interface import PartialBranches | ||||
from swh.web.common.typing import OriginInfo, OriginVisitInfo | from swh.web.common.typing import OriginInfo, OriginVisitInfo | ||||
def _group_checksums(data): | def _group_checksums(data): | ||||
"""Groups checksums values computed from hash functions used in swh | """Groups checksums values computed from hash functions used in swh | ||||
and stored in data dict under a single entry 'checksums' | and stored in data dict under a single entry 'checksums' | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines |