[Buildbot-commits] buildbot/buildbot/status html.py,1.40,1.41

Fred L. Drake fdrake at users.sourceforge.net
Tue Oct 12 19:04:56 UTC 2004


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

Modified Files:
	html.py 
Log Message:
avoid a number of string copies
(mostly just testing the syncmail changes)


Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- html.py	30 Sep 2004 10:05:42 -0000	1.40
+++ html.py	12 Oct 2004 19:04:53 -0000	1.41
@@ -126,29 +126,28 @@
     def body(self, request):
         s = self.step
         b = s.getBuild()
-        data = ""
-        data += "<h1>BuildStep %s:#%d:%s</h1>\n" % \
-                (b.getBuilder().getName(), b.getNumber(), s.getName())
+        data = "<h1>BuildStep %s:#%d:%s</h1>\n" % \
+               (b.getBuilder().getName(), b.getNumber(), s.getName())
 
         if s.isFinished():
-            data += "<h2>Finished</h2>\n"
-            data += "<p>%s</p>\n" % html.escape("%s" % s.getText())
+            data += ("<h2>Finished</h2>\n"
+                     "<p>%s</p>\n" % html.escape("%s" % s.getText()))
         else:
-            data += "<h2>Not Finished</h2>\n"
-            data += "<p>ETA %s seconds</p>\n" % s.getETA()
+            data += ("<h2>Not Finished</h2>\n"
+                     "<p>ETA %s seconds</p>\n" % s.getETA())
 
         exp = s.getExpectations()
         if exp:
-            data += "<h2>Expectations</h2>\n"
-            data += "<ul>\n"
+            data += ("<h2>Expectations</h2>\n"
+                     "<ul>\n")
             for e in exp:
                 data += "<li>%s: current=%s, target=%s</li>\n" % \
                         (html.escape(e[0]), e[1], e[2])
             data += "</ul>\n"
         logs = s.getLogs()
         if logs:
-            data += "<h2>Logs</h2>\n"
-            data += "<ul>\n"
+            data += ("<h2>Logs</h2>\n"
+                     "<ul>\n")
             for num in range(len(logs)):
                 data += '<li><a href="%s">%s</a></li>\n' % \
                         (urllib.quote(request.childLink("%d" % num)),
@@ -175,24 +174,23 @@
 
     def body(self, request):
         b = self.build
-        data = ""
         # the color in the following line gives python-mode trouble
-        data += "<h1>Build %s:#%d</h1>\n" % (b.getBuilder().getName(),
-                                             b.getNumber())
-        data += "<h2>Reason:</h2>\n%s\n" % html.escape(b.getReason())
-
+        data = ("<h1>Build %s:#%d</h1>\n"
+                "<h2>Reason:</h2>\n%s\n"
+                % (b.getBuilder().getName(), b.getNumber(),
+                   html.escape(b.getReason()))
         if b.isFinished():
             data += "<h2>Results:</h2>"
             data += " ".join(b.getText())
         else:
             data += "<h2>Build In Progress</h2>"
 
-        data += "<h2>Blamelist:</h2>\n"
-        data += " <ol>\n"
+        data += ("<h2>Blamelist:</h2>\n"
+                 " <ol>\n")
         for who in b.getResponsibleUsers():
             data += "  <li>%s</li>\n" % html.escape(who)
-        data += " </ol>\n"
-        data += "<h2>All Changes</h2>\n"
+        data += (" </ol>\n"
+                 "<h2>All Changes</h2>\n")
         changes = b.getChanges()
         if changes:
             data += "<ol>\n"





More information about the Commits mailing list