[Buildbot-commits] buildbot/buildbot/process properties.py, 1.1, 1.2

Brian Warner warner at users.sourceforge.net
Thu May 22 22:13:04 UTC 2008


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

Modified Files:
	properties.py 
Log Message:
[project @ #124:getProperty-returns-property-only.patch]
Change Property.getProperty to just return the property value, since
having getProperty return different things on different objects is
confusing.

Original author: dustin at v.igoro.us
Date: 2008-04-12 22:11:03+00:00

Index: properties.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/properties.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- properties.py	22 May 2008 22:12:57 -0000	1.1
+++ properties.py	22 May 2008 22:13:02 -0000	1.2
@@ -30,9 +30,12 @@
     def has_key(self, name):
         return self.properties.has_key(name)
 
-    def getProperty(self, name, default=(None,None)):
-        """Get the (value, source) tuple for the given property"""
-        return self.properties.get(name, default)
+    def getProperty(self, name, default=None):
+        """Get the value for the given property, with no None -> '' special case"""
+        return self.properties.get(name, default)[0]
+
+    def getPropertySource(self, name):
+        return self.properties[name][1]
 
     def setProperty(self, name, value, source):
         self.properties[name] = (value, source)





More information about the Commits mailing list