[Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.35, 1.36

Brian Warner warner at users.sourceforge.net
Thu May 22 22:12:32 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/status/web
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17087/buildbot/status/web

Modified Files:
	baseweb.py 
Log Message:
[project @ #246:stopLyingAboutForceBuild.diff]
Patch by Ben Hearsum <bhearsum at wittydomain.com>: don't appear to be
able to control builds when you can't

Original author: dustin at v.igoro.us
Date: 2008-04-20 21:38:35+00:00

Index: baseweb.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- baseweb.py	22 May 2008 22:11:25 -0000	1.35
+++ baseweb.py	22 May 2008 22:12:30 -0000	1.36
@@ -91,6 +91,7 @@
 
     def body(self, req):
         status = self.getStatus(req)
+        control = self.getControl(req)
         numbuilds = int(req.args.get("numbuilds", [self.numbuilds])[0])
         builders = req.args.get("builder", [])
         branches = [b for b in req.args.get("branch", []) if b]
@@ -122,12 +123,13 @@
             data += " <li>No matching builds found</li>\n"
         data += "</ul>\n"
 
-        if building:
-            stopURL = "builders/_all/stop"
-            data += make_stop_form(stopURL, True, "Builds")
-        if online:
-            forceURL = "builders/_all/force"
-            data += make_force_build_form(forceURL, True)
+        if control is not None:
+            if building:
+                stopURL = "builders/_all/stop"
+                data += make_stop_form(stopURL, True, "Builds")
+            if online:
+                forceURL = "builders/_all/force"
+                data += make_force_build_form(forceURL, True)
 
         return data
 
@@ -170,7 +172,7 @@
 # /one_box_per_builder
 #  accepts builder=, branch=
 class OneBoxPerBuilder(HtmlResource):
-    """This shows a narrow table with one row per build. The leftmost column
+    """This shows a narrow table with one row per builder. The leftmost column
     contains the builder name. The next column contains the results of the
     most recent build. The right-hand column shows the builder's current
     activity.
@@ -183,6 +185,7 @@
 
     def body(self, req):
         status = self.getStatus(req)
+        control = self.getControl(req)
 
         builders = req.args.get("builder", status.getBuilderNames())
         branches = [b for b in req.args.get("branch", []) if b]
@@ -231,12 +234,13 @@
 
         data += "</table>\n"
 
-        if building:
-            stopURL = "builders/_all/stop"
-            data += make_stop_form(stopURL, True, "Builds")
-        if online:
-            forceURL = "builders/_all/force"
-            data += make_force_build_form(forceURL, True)
+        if control is not None:
+            if building:
+                stopURL = "builders/_all/stop"
+                data += make_stop_form(stopURL, True, "Builds")
+            if online:
+                forceURL = "builders/_all/force"
+                data += make_force_build_form(forceURL, True)
 
         return data
 





More information about the Commits mailing list