Add missing callbacks for MODE_LOGS and logchunk callback for MODE_FULL.
authorTim Potter <tpot@hp.com>
Sun, 30 Mar 2008 02:51:03 +0000 (13:51 +1100)
committerTim Potter <tpot@hp.com>
Sun, 30 Mar 2008 02:51:03 +0000 (13:51 +1100)
bbmodel.py

index dbdf8e0..fff43d3 100644 (file)
@@ -139,7 +139,7 @@ class BBModel(pb.Referenceable):
         self.remote.notifyOnDisconnect(self.disconnected)
 
         self.remote.callRemote(
-            'subscribe', MODE_STEPS, self.updateInterval, self)
+            'subscribe', MODE_FULL, self.updateInterval, self)
 
     def disconnected(self, ref):
         
@@ -241,3 +241,49 @@ class BBModel(pb.Referenceable):
             log.msg('eta for build %s on "%s" is %s' % (num, buildername, eta))
 
         buildnum.addCallback(logEta)
+
+    def remote_stepETAUpdate(self, buildername, build, stepname, step,
+                             eta, expectations):
+
+        buildnum = build.callRemote('getNumber')
+
+        def logUpdate(num):
+            log.msg('eta for build %s on "%s", step "%s" is %s, expectations %s' % (num, buildername, stepname, eta, expectations))
+
+        buildnum.addCallback(logUpdate)
+
+    def remote_logStarted(self, buildername, build, stepname, step,
+                          logname, remotelog):
+
+        buildnum = build.callRemote('getNumber')
+
+        def logStart(num):
+            log.msg('log started for build %s on "%s", step "%s"' % 
+                    (num, buildername, stepname))
+
+        buildnum.addCallback(logStart)
+
+    def remote_logFinished(self, buildername, build, stepname, step,
+                           logname, remotelog):
+
+        buildnum = build.callRemote('getNumber')
+
+        def logFinished(num):
+            log.msg('log finished for build %s on "%s", step "%s"' % 
+                    (num, buildername, stepname))
+
+        buildnum.addCallback(logFinished)
+
+    # Subscription mode >= full
+
+    def remote_logChunk(self, buildername, build, stepname, step, logname,
+                        remotelog, channel, text):
+
+        buildnum = build.callRemote('getNumber')
+
+        def logChunk(num):
+            log.msg('got log chunk for build %s on "%s"' % (num, buildername))
+            log.msg('>>>%s<<<' % text)
+
+        buildnum.addCallback(logChunk)
+