Skip to content

Commit

Permalink
Don't print space before tags if there are no tags (jazzband#179)
Browse files Browse the repository at this point in the history
Also respect 79 char line limit and use double quotes
  • Loading branch information
MinchinWeb authored and SpotlightKid committed Dec 11, 2017
1 parent eb84455 commit d10b57f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions watson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,13 @@ def log(watson, current, from_, to, projects, tags, year, month, week, day,
)
)

lines.append('\n'.join(
'\t{id} {start} to {stop} {delta:>11} {project} {tags}'.format(
lines.append("\n".join(
"\t{id} {start} to {stop} {delta:>11} {project}{tags}".format(
delta=format_timedelta(frame.stop - frame.start),
project=style('project',
'{:>{}}'.format(frame.project, longest_project)),
pad=longest_project,
tags=style('tags', frame.tags),
tags=(" "*2 if frame.tags else "") + style('tags', frame.tags),
start=style('time', '{:HH:mm}'.format(frame.start)),
stop=style('time', '{:HH:mm}'.format(frame.stop)),
id=style('short_id', frame.id)
Expand Down Expand Up @@ -793,11 +793,11 @@ def edit(watson, id):

watson.save()
click.echo(
'Edited frame for project {project} {tags}, from {start} to {stop} '
'({delta})'.format(
"Edited frame for project {project}{tags}, from {start} to {stop} "
"({delta})".format(
delta=format_timedelta(stop - start) if stop else '-',
project=style('project', project),
tags=style('tags', tags),
tags=(" " if tags else "") + style('tags', tags),
start=style(
'time',
start.to(local_tz).format(time_format)
Expand Down Expand Up @@ -826,9 +826,9 @@ def remove(watson, id, force):
if not force:
click.confirm(
"You are about to remove frame "
"{project} {tags} from {start} to {stop}, continue?".format(
"{project}{tags} from {start} to {stop}, continue?".format(
project=style('project', frame.project),
tags=style('tags', frame.tags),
tags=(" " if tags else "") + style('tags', frame.tags),
start=style('time', '{:HH:mm}'.format(frame.start)),
stop=style('time', '{:HH:mm}'.format(frame.stop))
),
Expand Down

0 comments on commit d10b57f

Please sign in to comment.