Changeset View
Changeset View
Standalone View
Standalone View
swh/search/journal_client.py
# Copyright (C) 2018-2019 The Software Heritage developers | # Copyright (C) 2018-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 logging | import logging | ||||
EXPECTED_MESSAGE_TYPES = { | EXPECTED_MESSAGE_TYPES = { | ||||
"origin", | "origin", | ||||
Show All 33 Lines | def process_origin_visits(visits, search): | ||||
search.origin_update( | search.origin_update( | ||||
[ | [ | ||||
{ | { | ||||
"url": ( | "url": ( | ||||
visit["origin"] | visit["origin"] | ||||
if isinstance(visit["origin"], str) | if isinstance(visit["origin"], str) | ||||
else visit["origin"]["url"] | else visit["origin"]["url"] | ||||
), | ), | ||||
"visit_types": [visit["type"]], | |||||
} | } | ||||
for visit in visits | for visit in visits | ||||
] | ] | ||||
) | ) | ||||
def process_origin_visit_statuses(visit_statuses, search): | def process_origin_visit_statuses(visit_statuses, search): | ||||
logging.debug("processing origin visit statuses %r", visit_statuses) | logging.debug("processing origin visit statuses %r", visit_statuses) | ||||
Show All 20 Lines |