Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/service.py
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | Returns: | ||||
origin as dictionary if found for the given content. | origin as dictionary if found for the given content. | ||||
""" | """ | ||||
algo, hash = query.parse_hash(q) | algo, hash = query.parse_hash(q) | ||||
origin = backend.content_find_occurrence(algo, hash) | origin = backend.content_find_occurrence(algo, hash) | ||||
return converters.from_origin(origin) | return converters.from_origin(origin) | ||||
def lookup_origin(origin_id): | def lookup_origin(origin): | ||||
"""Return information about the origin with id origin_id. | """Return information about the origin matching dict origin. | ||||
Args: | Args: | ||||
origin_id as string | origin: origin's dict with keys either 'id' or | ||||
('type' AND 'url') | |||||
Returns: | Returns: | ||||
origin information as dict. | origin information as dict. | ||||
""" | """ | ||||
return backend.origin_get(origin_id) | return backend.origin_get(origin) | ||||
def lookup_person(person_id): | def lookup_person(person_id): | ||||
"""Return information about the person with id person_id. | """Return information about the person with id person_id. | ||||
Args: | Args: | ||||
person_id as string | person_id as string | ||||
▲ Show 20 Lines • Show All 527 Lines • Show Last 20 Lines |