[Buildbot-commits] buildbot/buildbot/status builder.py, 1.84, 1.85 html.py, 1.87, 1.88

Brian Warner warner at users.sourceforge.net
Sun Aug 20 22:25:37 UTC 2006


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

Modified Files:
	builder.py html.py 
Log Message:
[project @ add BuildStep URLs]

Original author: warner at lothar.com
Date: 2006-08-20 22:24:14

Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- builder.py	16 Jun 2006 05:28:13 -0000	1.84
+++ builder.py	20 Aug 2006 22:25:35 -0000	1.85
@@ -647,7 +647,7 @@
         self.observers.remove(observer)
 
 
-class BuildStepStatus:
+class BuildStepStatus(styles.Versioned):
     """
     I represent a collection of output status for a
     L{buildbot.process.step.BuildStep}.
@@ -672,6 +672,7 @@
         implements(interfaces.IBuildStepStatus, interfaces.IStatusEvent)
     else:
         __implements__ = interfaces.IBuildStepStatus, interfaces.IStatusEvent
+    persistenceVersion = 1
 
     started = None
     finished = None
@@ -688,6 +689,7 @@
         assert interfaces.IBuildStatus(parent)
         self.build = parent
         self.logs = []
+        self.urls = {}
         self.watchers = []
         self.updates = {}
         self.finishedWatchers = []
@@ -718,6 +720,8 @@
     def getLogs(self):
         return self.logs
 
+    def getURLs(self):
+        return self.urls.copy()
 
     def isFinished(self):
         return (self.finished is not None)
@@ -846,6 +850,9 @@
         for w in self.watchers:
             w.logFinished(self.build, self, log)
 
+    def addURL(self, name, url):
+        self.urls[name] = url
+
     def setColor(self, color):
         self.color = color
     def setText(self, text):
@@ -873,7 +880,7 @@
     # persistence
 
     def __getstate__(self):
-        d = self.__dict__.copy()
+        d = styles.Versioned.__getstate__(self)
         del d['build'] # filled in when loading
         if d.has_key('progress'):
             del d['progress']
@@ -883,11 +890,15 @@
         return d
 
     def __setstate__(self, d):
-        self.__dict__ = d
+        styles.Versioned.__setstate__(self, d)
         # self.build must be filled in by our parent
         for loog in self.logs:
             loog.step = self
 
+    def upgradeToVersion1(self):
+        if not hasattr(self, "urls"):
+            self.urls = {}
+
 
 class BuildStatus(styles.Versioned):
     if implements:

Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- html.py	16 Jul 2006 00:58:31 -0000	1.87
+++ html.py	20 Aug 2006 22:25:35 -0000	1.88
@@ -958,6 +958,9 @@
                 text.append("<a href=\"%s\">%s</a>" % (url, html.escape(name)))
             else:
                 text.append(html.escape(name))
+        urls = self.original.getURLs()
+        for name, target in urls.items():
+            text.append('[<a href="%s">%s</a>]' % (target, html.escape(name)))
         color = self.original.getColor()
         class_ = "BuildStep " + build_get_class(self.original)
         return Box(text, color, class_=class_)





More information about the Commits mailing list