[Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.14, 1.15

Brian Warner warner at users.sourceforge.net
Sun Aug 12 21:15:53 UTC 2007


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

Modified Files:
	baseweb.py 
Log Message:
[project @ web: improve OneLinePerBuild format a bit]

Original author: warner at lothar.com
Date: 2007-08-12 21:15:33+00:00

Index: baseweb.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- baseweb.py	12 Aug 2007 18:34:43 -0000	1.14
+++ baseweb.py	12 Aug 2007 21:15:50 -0000	1.15
@@ -63,6 +63,8 @@
 
 
 class OneLineMixin:
+    LINE_TIME_FORMAT = "%b %d %H:%M"
+
     def make_line(self, req, build):
         builder_name = build.getBuilder().getName()
         results = build.getResults()
@@ -84,17 +86,16 @@
                                                           build.getNumber())),
                   'builderurl': (root + "builders/%s" % builder_name),
                   'rev': rev,
-                  'time': time.strftime("%Y-%m-%d %H:%M:%S",
+                  'time': time.strftime(self.LINE_TIME_FORMAT,
                                         time.localtime(build.getTimes()[0])),
                   }
 
-        fmt = ('<div>'
-               '<font size="-1">(%(time)s)</font> '
+        fmt = ('<font size="-1">(%(time)s)</font> '
                '<a href="%(builderurl)s">%(builder_name)s</a> '
-               'rev=[%(rev)s]: '
+               'rev=[%(rev)s] '
+               '<a href="%(buildurl)s">#%(buildnum)d</a>: '
                '<span class="%(class)s">%(results)s</span> '
-               '<a href="%(buildurl)s">#%(buildnum)d</a> '
-               '</div>\n')
+               )
         data = fmt % values
         return data
 
@@ -132,13 +133,14 @@
         data += "<h1>Last %d finished builds</h1>\n" % numbuilds
         if builders:
             data += ("<p>of builders: %s</p>\n" % (", ".join(builders)))
-
+        data += "<ul>\n"
         got = 0
         for build in g:
             got += 1
-            data += self.make_line(req, build)
+            data += " <li>" + self.make_line(req, build) + "</li>\n"
         if not got:
-            data += "<div>No matching builds found</div>\n"
+            data += " <li>No matching builds found</li>\n"
+        data += "</ul>\n"
         return data
 
 
@@ -164,12 +166,14 @@
         data = ""
         data += ("<h1>Last %d builds of builder: %s</h1>\n" %
                  (numbuilds, self.builder_name))
+        data += "<ul>\n"
         got = 0
         for build in g:
             got += 1
-            data += self.make_line(req, build)
+            data += " <li>" + self.make_line(req, build) + "</li>\n"
         if not got:
-            data += "<div>No matching builds found</div>\n"
+            data += " <li>No matching builds found</li>\n"
+        data += "</ul>\n"
 
         return data
 





More information about the Commits mailing list