[Buildbot-commits] buildbot/buildbot interfaces.py,1.46,1.47

Brian Warner warner at users.sourceforge.net
Fri Sep 15 14:48:55 UTC 2006


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

Modified Files:
	interfaces.py 
Log Message:
[project @ enhance IStatusLog.readlines to accept a channel= argument]

Original author: warner at lothar.com
Date: 2006-09-08 21:55:02

Index: interfaces.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- interfaces.py	15 Sep 2006 14:48:44 -0000	1.46
+++ interfaces.py	15 Sep 2006 14:48:53 -0000	1.47
@@ -557,6 +557,11 @@
         """Returns a single string with the color that should be used to
         display this event. 'red' and 'yellow' are the most likely ones."""
 
+
+LOG_CHANNEL_STDOUT = 0
+LOG_CHANNEL_STDERR = 1
+LOG_CHANNEL_HEADER = 2
+
 class IStatusLog(Interface):
     """I represent a single Log, which is a growing list of text items that
     contains some kind of output for a single BuildStep. I might be finished,
@@ -661,9 +666,11 @@
         """Return one big string with the contents of the Log. This merges
         all non-header chunks together."""
 
-    def readlines():
-        """Return a list (really an iterator) of newline-terminated lines,
-        excluding header chunks."""
+    def readlines(channel=LOG_CHANNEL_STDOUT):
+        """Read lines from one channel of the logfile. This returns an
+        iterator that will provide single lines of text (including the
+        trailing newline).
+        """
 
     def getTextWithHeaders():
         """Return one big string with the contents of the Log. This merges
@@ -674,10 +681,6 @@
         0 for stdout, 1 for stderr, 2 for header. (note that stderr is merged
         into stdout if PTYs are in use)."""
 
-LOG_CHANNEL_STDOUT = 0
-LOG_CHANNEL_STDERR = 1
-LOG_CHANNEL_HEADER = 2
-
 class IStatusLogConsumer(Interface):
     """I am an object which can be passed to IStatusLog.subscribeConsumer().
     I represent a target for writing the contents of an IStatusLog. This





More information about the Commits mailing list