From 5927ce7489892dae91d8aabf09c870a0d93190fe Mon Sep 17 00:00:00 2001
From: Benoit Sigoure <tsuna@lrde.epita.fr>
Date: Wed, 7 Nov 2007 23:26:19 +0100
Subject: [PATCH 03/11] Add a `Stop Builder' button next to the `Force Build' one.
I find it more convenient and natural to be able to start/stop
builds from the same page.
* buildbot/status/web/builder.py (StatusResourceBuilder.build_line):
Here.
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
---
buildbot/status/web/builder.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/buildbot/status/web/builder.py b/buildbot/status/web/builder.py
index e56d1fd..4cabf0d 100644
|
a
|
b
|
class StatusResourceBuilder(HtmlResource, OneLineMixin): |
| 28 | 28 | buildnum = build.getNumber() |
| 29 | 29 | buildurl = req.childLink("builds/%d" % buildnum) |
| 30 | 30 | data = '<a href="%s">#%d</a> ' % (buildurl, buildnum) |
| | 31 | |
| 31 | 32 | when = build.getETA() |
| 32 | 33 | if when is not None: |
| 33 | 34 | when_time = time.strftime("%H:%M:%S", |
| 34 | 35 | time.localtime(time.time() + when)) |
| 35 | 36 | data += "ETA %ds (%s) " % (when, when_time) |
| 36 | 37 | data += "[%s]" % build.getCurrentStep().getName() |
| | 38 | |
| | 39 | if self.builder_control is not None: |
| | 40 | stopURL = urllib.quote(req.childLink("builds/%d/stop" % buildnum)) |
| | 41 | data += ''' |
| | 42 | <form action="%s" class="command stopbuild" style="display:inline"> |
| | 43 | <input type="submit" value="Stop Builder" /> |
| | 44 | </form>''' % stopURL |
| | 45 | |
| 37 | 46 | return data |
| 38 | 47 | |
| 39 | 48 | def body(self, req): |