[Buildbot-commits] buildbot/buildbot/status html.py,1.66,1.67 words.py,1.39,1.40

Brian Warner warner at users.sourceforge.net
Thu Sep 1 20:53:23 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23210/buildbot/status

Modified Files:
	html.py words.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-309
Creator:  Brian Warner <warner at lothar.com>

update IBuilderStatus.getState signature

	* buildbot/interfaces.py (IBuilderStatus.getState): update
	signature, point out that 'build' can be None
	(IBuildStatus.getETA): point out ETA can be none

	* buildbot/status/html.py (CurrentBox.getBox): tolerate build/ETA
	being None
	* buildbot/status/words.py (IrcStatusBot.emit_status): same


Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- html.py	31 Aug 2005 01:51:42 -0000	1.66
+++ html.py	1 Sep 2005 20:53:21 -0000	1.67
@@ -687,7 +687,11 @@
         color = "white"
         if state == "building":
             color = "yellow"
-            text = ["building"] + self.formatETA(build.getETA())
+            text = ["building"]
+            if build:
+                eta = build.getETA()
+                if eta:
+                    text.extend(self.formatETA(eta))
         elif state == "offline":
             color = "red"
             text = ["offline"]

Index: words.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- words.py	11 Aug 2005 21:58:42 -0000	1.39
+++ words.py	1 Sep 2005 20:53:21 -0000	1.40
@@ -211,9 +211,6 @@
             str = "Configured builders: "
             for b in builders:
                 str += b.name
-                # FIXME: b is a buildbot.status.builder.BuilderStatus
-                # has no .remote, so maybe it should be added there
-                #if not b.remote:
                 state = b.getState()[0]
                 if state == 'offline':
                     str += "[offline]"
@@ -362,12 +359,12 @@
                        (int(util.now() - finished), " ".join(last.getText()))
         if state == "building":
             build = b.getCurrentBuild()
-            assert build
-            step = build.getCurrentStep()
-            str += " (%s)" % " ".join(step.getText())
-            ETA = build.getETA()
-            if ETA is not None:
-                str += " [ETA %s]" % self.convertTime(ETA)
+            if build:
+                step = build.getCurrentStep()
+                str += " (%s)" % " ".join(step.getText())
+                ETA = build.getETA()
+                if ETA is not None:
+                    str += " [ETA %s]" % self.convertTime(ETA)
         self.reply(reply, str)
 
     def emit_last(self, reply, which):





More information about the Commits mailing list