[Buildbot-commits] buildbot/buildbot/status builder.py,1.86,1.87

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


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

Modified Files:
	builder.py 
Log Message:
[project @ add IStatusLog.readlines()]

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

Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- builder.py	6 Sep 2006 00:41:55 -0000	1.86
+++ builder.py	15 Sep 2006 14:48:44 -0000	1.87
@@ -13,6 +13,10 @@
     pickle = cPickle
 except ImportError:
     import pickle
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
 
 # sibling imports
 from buildbot import interfaces, util, sourcestamp
@@ -334,6 +338,15 @@
             else:
                 yield leftover
 
+    def readlines(self):
+        """Return an iterator that produces newline-terminated lines,
+        excluding header chunks."""
+        # TODO: make this memory-efficient, by turning it into a generator
+        # that retrieves chunks as necessary, like a pull-driven version of
+        # twisted.protocols.basic.LineReceiver
+        io = StringIO(self.getText())
+        return io.readlines()
+
     def subscribe(self, receiver, catchup):
         if self.finished:
             return





More information about the Commits mailing list