Skip to content

Commit

Permalink
Always show total time at bottom of report (#357)
Browse files Browse the repository at this point in the history
* Always show total time at bottom of report
* Update Changelog

Co-authored-by: Philipp Metzner <philipp.metzner@reactive-robotics.com>
  • Loading branch information
pylipp and Philipp Metzner authored Mar 25, 2020
1 parent 2c7a17e commit d28a2bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve Arrow 0.15.0 support after changes in `arrow.get()` behavior (#296)
- Watson now suggests correct command if users make small typo (#318)

### Changed

- Always show total time at bottom of report (#356)

### Fixed

- Stylize prompt to create new project or tag (#310).
Expand Down
23 changes: 10 additions & 13 deletions watson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,21 +691,18 @@ def _final_print(lines):
))
_print("")

# only show total time at the bottom for a project if it is not
# an aggregate report and there is greater than 1 project
if len(projects) > 1 and not aggregated:
_print('Total: {}'.format(
style('time', '{}'.format(format_timedelta(
datetime.timedelta(seconds=report['time'])
)))
))

# if this is a report invoked from `aggregate`
# return the lines
# if this is a report invoked from `aggregate` return the lines; do not
# show total time
if aggregated:
return lines
else:
_final_print(lines)

_print('Total: {}'.format(
style('time', '{}'.format(format_timedelta(
datetime.timedelta(seconds=report['time'])
)))
))

_final_print(lines)


@cli.command()
Expand Down

0 comments on commit d28a2bd

Please sign in to comment.