Message50610
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. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:53:19 | admin | link | issue1517586 messages |
| 2007-08-23 15:53:19 | admin | create | |
|