[Buildbot-commits] buildbot/buildbot/status/web build.py, 1.19, 1.20

Brian Warner warner at users.sourceforge.net
Thu Jul 24 23:00:50 UTC 2008


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

Modified Files:
	build.py 
Log Message:
[project @ web/build.py: handle property display better for large values, HTML escape them]

Original author: warner at lothar.com
Date: 2008-07-24 22:28:39+00:00

Index: build.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- build.py	24 Jul 2008 00:58:03 -0000	1.19
+++ build.py	24 Jul 2008 23:00:48 -0000	1.20
@@ -124,9 +124,16 @@
         data += "<h2>Build Properties:</h2>\n"
         data += "<table><tr><th valign=\"left\">Name</th><th valign=\"left\">Value</th><th valign=\"left\">Source</th></tr>\n"
         for name, value, source in b.getProperties().asList():
-            data += "<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n" % (name, value, source)
+            value = str(value)
+            if len(value) > 500:
+                value = value[:500] + " .. [property value too long]"
+            data += "<tr>"
+            data += "<td>%s</td>" % html.escape(name)
+            data += "<td>%s</td>" % html.escape(value)
+            data += "<td>%s</td>" % html.escape(source)
+            data += "</tr>\n"
         data += "</table>"
-            
+
         data += "<h2>Blamelist:</h2>\n"
         if list(b.getResponsibleUsers()):
             data += " <ol>\n"





More information about the Commits mailing list