Skip to content

Commit

Permalink
get: print comment # aligned to the right
Browse files Browse the repository at this point in the history
With this change and preceding real name and date/time changes a comment
header gets as close to the WebUI as possible.
  • Loading branch information
glebius committed Dec 27, 2023
1 parent f68ed84 commit 3dd9b03
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bugz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,15 @@ def show_bug_info(bug, settings):
else:
who = comment['creator']
when = parsetime(comment['time'])
what = comment['text']
print('[Comment #%d] %s %s' % (i, who, printtime(when, settings)))
header_left = '%s %s' % (who, printtime(when, settings))
header_right = '[Comment %d]' % i
space = settings.columns - len(header_left) - len(header_right) - 3
if space < 0:
space = 0
print(header_left, ' ' * space, header_right)
print('-' * (settings.columns - 1))

what = comment['text']
if what is None:
what = ''

Expand Down

0 comments on commit 3dd9b03

Please sign in to comment.