Skip to content

Commit

Permalink
Fix display of not-yet-run steps, and standardize ETA display
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris AtLee committed Mar 9, 2010
1 parent b19876d commit 767bada
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
16 changes: 6 additions & 10 deletions buildbot/status/web/build.py
Expand Up @@ -37,7 +37,7 @@ def content(self, req, cxt):
if not b.isFinished():
when = b.getETA()
if when is not None:
cxt['when'] = when
cxt['when'] = util.formatInterval(when)
cxt['when_time'] = time.strftime("%H:%M:%S",
time.localtime(time.time() + when))

Expand Down Expand Up @@ -73,21 +73,17 @@ def content(self, req, cxt):
for s in b.getSteps():
step = {'name': s.getName() }
cxt['steps'].append(step)

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

step['time_to_run'] = time_to_run

if s.isFinished():
step['css_class'] = css_classes[s.getResults()[0]]
(start, end) = s.getTimes()
step['time_to_run'] = util.formatInterval(end - start)
elif s.isStarted():
step['css_class'] = "running"
else:
step['time_to_run'] = "running"
else:
step['css_class'] = "not_started"
step['time_to_run'] = ""

step['link'] = req.childLink("steps/%s" % urllib.quote(s.getName()))
step['text'] = " ".join(s.getText())
Expand Down
3 changes: 2 additions & 1 deletion buildbot/status/web/builder.py
Expand Up @@ -31,8 +31,9 @@ def builder(self, build, req):
b['num'] = build.getNumber()
b['link'] = path_to_build(req, build)

when = b['when'] = build.getETA()
when = build.getETA()
if when is not None:
b['when'] = util.formatInterval(when)
b['when_time'] = time.strftime("%H:%M:%S",
time.localtime(time.time() + when))

Expand Down
4 changes: 2 additions & 2 deletions buildbot/status/web/templates/build.html
Expand Up @@ -15,7 +15,7 @@ <h1>
<h2>Build In Progress:</h2>

{% if when_time %}
<p>ETA: {{ when }}s ({{ when_time }})</p>
<p>ETA: {{ when_time }} [{{ when }}]</p>
{% endif %}

{% if authz.advertiseAction('stopBuild') %}
Expand Down 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 }})</span>
{{ s.text }}&nbsp;<span style="float:right">{{ '( ' + s.time_to_run + ' )' if s.time_to_run else '' }}</span>
</div>

<ol>
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/builder.html
Expand Up @@ -16,7 +16,7 @@ <h2>Current Builds:</h2>
{% for b in current %}
<li><a href="{{ b.link }}">{{ b.num }}</a>
{% if b.when %}
ETA: {{ b.when_time }} [{{ b.when }}s]
ETA: {{ b.when_time }} [{{ b.when }}]
{% endif %}

{{ b.current_step }}
Expand Down

0 comments on commit 767bada

Please sign in to comment.