Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/backend.py
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | Returns: | ||||
The directory's information. | The directory's information. | ||||
""" | """ | ||||
res = main.storage().directory_get([sha1_bin]) | res = main.storage().directory_get([sha1_bin]) | ||||
if res and len(res) >= 1: | if res and len(res) >= 1: | ||||
return res[0] | return res[0] | ||||
def origin_get(origin_id): | def origin_get(origin): | ||||
"""Return information about the origin with id origin_id. | """Return information about the origin matching dict origin. | ||||
Args: | Args: | ||||
origin_id: origin's identifier | origin: origin's dict with keys either 'id' or | ||||
('type' AND 'url') | |||||
Returns: | Returns: | ||||
Origin information as dict. | Origin information as dict. | ||||
""" | """ | ||||
return main.storage().origin_get({'id': origin_id}) | return main.storage().origin_get(origin) | ||||
def person_get(person_id): | def person_get(person_id): | ||||
"""Return information about the person with id person_id. | """Return information about the person with id person_id. | ||||
Args: | Args: | ||||
person_id: person's identifier.v | person_id: person's identifier.v | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |