def format_data(self, name, data):
"""Re-format the response data for the front-end.
Arguments:
data (:py:class:`dict`): The JSON data from the response.
name (:py:class:`str`): The name of the repository.
Returns:
:py:class:`dict`: The re-formatted data.
"""
builds = [self.format_build(build) for build in data.get('builds', [])]
return dict(
builds=builds[:4],
health=self.health(builds[0] if builds else None),
name=name,
)
评论列表
文章目录