diff options
author | Leandro Lucarella <leandro.lucarella@sociomantic.com> | 2014-04-25 18:33:28 +0200 |
---|---|---|
committer | Mihails Strasuns <mihails.strasuns@sociomantic.com> | 2014-04-30 11:07:33 +0200 |
commit | a73246ca00069695a11e7b9641afb2fd4b3f09a8 (patch) | |
tree | 7a91888bd92b9226c20e683d38c9265f3efc3d0f | |
parent | a451683a1655262cd9f5fe1766558e4589a9f1e1 (diff) |
issue show: Improve issue formatting
-rwxr-xr-x | git-hub | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -811,28 +811,27 @@ class IssueUtil (object): @classmethod def print_issue(cls, issue, comments): issue = dict(issue) - issue['labels'] = ', '.join([l['name'] + issue['name'] = cls.name.capitalize() + issue['comments'] += issue.get('review_comments', 0) + issue['labels'] = ' '.join(['['+l['name']+']' for l in issue.get('labels', [])]) - infof( - (u""" -Issue {number} -========= - -Title : {title} -User : {user[login]} -State : {state} -Comments: {comments} -URL : {html_url} -Labels : {labels} - -Contents -======== + if issue['labels']: + issue['labels'] += '\n' + infof(u""" +#{number}: {title} +================================================================================ +{name} is {state}, was reported by {user[login]} and has {comments} comment(s). +{labels}<{html_url}> + {body} -""" - ), **issue) +""", + **issue) for comment in comments: - infof(u'[{created_at}][{user[login]}]:\n{body}\n', **comment) + body = comment['body'] + body = '\n'.join([' '+l for l in body.splitlines()]) + infof(u'On {created_at}, {user[login]} commented:\n' + '{0}\n\n <{html_url}>\n', body, **comment) @classmethod def print_comment(cls, comment): |