[Patches] [ python-Patches-1517586 ] Patch to commands.py to enable callback support

SourceForge.net noreply at sourceforge.net
Wed Jul 5 17:31:25 CEST 2006


Patches item #1517586, was opened at 2006-07-05 08:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1517586&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Brad Doctor (bdoctor)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch to commands.py to enable callback support 

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1517586&group_id=5470


More information about the Patches mailing list