Changeset View
Changeset View
Standalone View
Standalone View
swh/search/in_memory.py
Show All 9 Lines | |||||
from typing import Any, Dict, Iterable, Iterator, List, Optional | from typing import Any, Dict, Iterable, Iterator, List, Optional | ||||
from swh.core.api import remote_api_endpoint | from swh.core.api import remote_api_endpoint | ||||
from swh.model.identifiers import origin_identifier | from swh.model.identifiers import origin_identifier | ||||
from swh.search.interface import PagedResult | from swh.search.interface import PagedResult | ||||
def _sanitize_origin(origin): | |||||
origin = origin.copy() | |||||
res = {"url": origin.pop("url")} | |||||
for field_name in ("type", "intrinsic_metadata"): | |||||
if field_name in origin: | |||||
res[field_name] = origin.pop(field_name) | |||||
return res | |||||
class InMemorySearch: | class InMemorySearch: | ||||
def __init__(self): | def __init__(self): | ||||
pass | pass | ||||
@remote_api_endpoint("check") | @remote_api_endpoint("check") | ||||
def check(self): | def check(self): | ||||
return True | return True | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |