[Buildbot-commits] buildbot/buildbot/status builder.py, 1.108, 1.109

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


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

Modified Files:
	builder.py 
Log Message:
[project @ #124:properties-class.patch]
Add and use a Properties class, refactor the way properties are rendered,
and update unit tests accordingly.

Original author: dustin at v.igoro.us
Date: 2008-04-12 20:58:59+00:00

Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- builder.py	22 May 2008 22:12:52 -0000	1.108
+++ builder.py	22 May 2008 22:12:57 -0000	1.109
@@ -5,6 +5,7 @@
 from twisted.persisted import styles
 from twisted.internet import reactor, defer
 from twisted.protocols import basic
+from buildbot.process.properties import Properties
 
 import os, shutil, sys, re, urllib, itertools
 from cPickle import load, dump
@@ -888,7 +889,7 @@
 
 class BuildStatus(styles.Versioned):
     implements(interfaces.IBuildStatus, interfaces.IStatusEvent)
-    persistenceVersion = 2
+    persistenceVersion = 3
 
     source = None
     reason = None
@@ -924,7 +925,7 @@
         self.finishedWatchers = []
         self.steps = []
         self.testResults = {}
-        self.properties = {}
+        self.properties = Properties()
 
     # IBuildStatus
 
@@ -937,6 +938,9 @@
     def getProperty(self, propname):
         return self.properties[propname]
 
+    def getProperties(self):
+        return self.properties
+
     def getNumber(self):
         return self.number
 
@@ -1074,8 +1078,8 @@
         self.steps.append(s)
         return s
 
-    def setProperty(self, propname, value):
-        self.properties[propname] = value
+    def setProperty(self, propname, value, source):
+        self.properties.setProperty(propname, value, source)
 
     def addTestResult(self, result):
         self.testResults[result.getName()] = result
@@ -1229,6 +1233,12 @@
     def upgradeToVersion2(self):
         self.properties = {}
 
+    def upgradeToVersion3(self):
+        # in version 3, self.properties became a Properties object
+        propdict = self.properties
+        self.properties = Properties()
+        self.properties.update(propdict)
+
     def upgradeLogfiles(self):
         # upgrade any LogFiles that need it. This must occur after we've been
         # attached to our Builder, and after we know about all LogFiles of





More information about the Commits mailing list