def format_data(cls, name, data):
"""Re-format the response data for the front-end.
Arguments:
data (:py:class:`list`): The JSON data from the response.
name (:py:class:`str`): The name of the repository.
Returns:
:py:class:`dict`: The re-formatted data.
"""
return dict(
commits=[cls.format_commit(commit.get('commit', {}))
for commit in data[:5] or []],
name=name,
)
评论列表
文章目录