[Buildbot-commits] buildbot/buildbot/process step.py,1.94,1.95

Brian Warner warner at users.sourceforge.net
Tue Jun 20 08:09:18 UTC 2006


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

Modified Files:
	step.py 
Log Message:
[project @ step.py: generalize OutputProgressObserver]

Original author: warner at lothar.com
Date: 2006-06-20 06:21:11

Index: step.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- step.py	20 Jun 2006 08:09:04 -0000	1.94
+++ step.py	20 Jun 2006 08:09:15 -0000	1.95
@@ -840,13 +840,15 @@
         return d
 
 
-class StdioProgressObserver(LogObserver):
+class OutputProgressObserver(LogObserver):
     length = 0
 
+    def __init__(self, name):
+        self.name = name
+
     def logChunk(self, build, step, log, channel, text):
         self.length += len(text)
-        self.step.setProgress("output", self.length)
-
+        self.step.setProgress(self.name, self.length)
 
 class LoggingBuildStep(BuildStep):
     """This is an abstract base class, suitable for inheritance by all
@@ -857,7 +859,7 @@
 
     def __init__(self, *args, **kwargs):
         BuildStep.__init__(self, *args, **kwargs)
-        self.addLogObserver('stdio', StdioProgressObserver())
+        self.addLogObserver('stdio', OutputProgressObserver("output"))
 
     def describe(self, done=False):
         raise NotImplementedError("implement this in a subclass")





More information about the Commits mailing list