Author bdoctor
Recipients
Date 2006-07-05.15:31:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This is a patch to commands.py to enable callback
support, which is very useful for long-running
commands. Whenever there is stdout from the process the
callback is fed whatever it got.  Example usage:

import commands

cmd = 'top -b -n2'

def fancy(out):
    print 'GOT(%s)' % out.strip()

commands.cb = fancy

(s,o) = commands.getstatusoutput(cmd)
print 'OUTPUT (%s)' % o

Please consider adding this.  The existing API is not
changed, however as you can see it is simple to use the
callback.
History
Date User Action Args
2007-08-23 15:53:19adminlinkissue1517586 messages
2007-08-23 15:53:19admincreate