[Buildbot-commits] buildbot/buildbot twcompat.py,1.13,1.14
Brian Warner
warner at users.sourceforge.net
Mon Dec 11 09:11:20 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21333/buildbot
Modified Files:
twcompat.py
Log Message:
[project @ remove the monkeypatched t.i.utils.getProcessOutputAndValue, unnecessary with twisted-2.0.0 and later]
Original author: warner at lothar.com
Date: 2006-12-11 08:59:19
Index: twcompat.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/twcompat.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- twcompat.py 11 Dec 2006 09:11:10 -0000 1.13
+++ twcompat.py 11 Dec 2006 09:11:18 -0000 1.14
@@ -11,49 +11,6 @@
from twisted.copyright import version
-from twisted.internet import utils
-if not hasattr(utils, "getProcessOutputAndValue"):
- from twisted.internet import reactor, protocol
- _callProtocolWithDeferred = utils._callProtocolWithDeferred
- try:
- import cStringIO
- StringIO = cStringIO
- except ImportError:
- import StringIO
-
- class _EverythingGetter(protocol.ProcessProtocol):
-
- def __init__(self, deferred):
- self.deferred = deferred
- self.outBuf = StringIO.StringIO()
- self.errBuf = StringIO.StringIO()
- self.outReceived = self.outBuf.write
- self.errReceived = self.errBuf.write
-
- def processEnded(self, reason):
- out = self.outBuf.getvalue()
- err = self.errBuf.getvalue()
- e = reason.value
- code = e.exitCode
- if e.signal:
- self.deferred.errback((out, err, e.signal))
- else:
- self.deferred.callback((out, err, code))
-
- def getProcessOutputAndValue(executable, args=(), env={}, path='.',
- reactor=reactor):
- """Spawn a process and returns a Deferred that will be called back
- with its output (from stdout and stderr) and it's exit code as (out,
- err, code) If a signal is raised, the Deferred will errback with the
- stdout and stderr up to that point, along with the signal, as (out,
- err, signalNum)
- """
- return _callProtocolWithDeferred(_EverythingGetter,
- executable, args, env, path,
- reactor)
- utils.getProcessOutputAndValue = getProcessOutputAndValue
-
-
# copied from Twisted circa 2.2.0
def _which(name, flags=os.X_OK):
"""Search PATH for executable files with the given name.
More information about the Commits
mailing list