def format_build(cls, build):
"""Re-format the build data for the front-end.
Arguments:
build (:py:class:`dict`): The JSON data from the response.
Returns:
:py:class:`dict`: The re-formatted data.
"""
start, finish, elapsed = elapsed_time(
build.get('started_at'),
build.get('finished_at'),
)
return super().format_build(dict(
author=build.get('github_username'),
duration=(
None if start is None or finish is None else finish - start
),
elapsed=elapsed,
message=build.get('message'),
outcome=build.get('status'),
started_at=start,
))
评论列表
文章目录