Skip to content

Commit

Permalink
Make step elapsed time use util.formatInterval
Browse files Browse the repository at this point in the history
Also have it show "running" instead of "0.0s" when the step isn't done
yet.
  • Loading branch information
Chris AtLee committed Mar 5, 2010
1 parent d04983d commit 155fa78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions buildbot/status/web/build.py
Expand Up @@ -74,13 +74,13 @@ def content(self, req, cxt):
step = {'name': s.getName() }
cxt['steps'].append(step)

time_to_run = 0
(start, end) = s.getTimes()
if start and end:
time_to_run = end - start
time_to_run = util.formatInterval(end - start)
else:
time_to_run = "running"

# todo: format to 1h 5m 17s
step['time_to_run'] = '%.1f' % time_to_run
step['time_to_run'] = time_to_run

if s.isFinished():
step['css_class'] = css_classes[s.getResults()[0]]
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/build.html
Expand Up @@ -98,7 +98,7 @@ <h2>Steps and Logfiles:</h2>
<li>
<div class="{{ s.css_class }} result">
<a href="{{ s.link }}">{{ s.name }}</a>
{{ s.text }}&nbsp;<span style="float:right">({{ s.time_to_run }} s)</span>
{{ s.text }}&nbsp;<span style="float:right">({{ s.time_to_run }})</span>
</div>

<ol>
Expand Down

0 comments on commit 155fa78

Please sign in to comment.