Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/service.py
Show First 20 Lines • Show All 561 Lines • ▼ Show 20 Lines | def stat_counters(): | ||||
"""Return the stat counters for Software Heritage | """Return the stat counters for Software Heritage | ||||
Returns: | Returns: | ||||
A dict mapping textual labels to integer values. | A dict mapping textual labels to integer values. | ||||
""" | """ | ||||
return backend.stat_counters() | return backend.stat_counters() | ||||
def stat_origin_visits(origin_id): | |||||
"""Return the dates at which the given origin was scanned for content. | |||||
Returns: | |||||
An array of dates in the datetime format | |||||
""" | |||||
for visit in backend.stat_origin_visits(origin_id): | |||||
visit['date'] = visit['date'].timestamp() | |||||
yield(visit) | |||||
def lookup_entity_by_uuid(uuid): | def lookup_entity_by_uuid(uuid): | ||||
"""Return the entity's hierarchy from its uuid. | """Return the entity's hierarchy from its uuid. | ||||
Args: | Args: | ||||
uuid: entity's identifier. | uuid: entity's identifier. | ||||
Returns: | Returns: | ||||
List of hierarchy entities from the entity with uuid. | List of hierarchy entities from the entity with uuid. | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |