Re: [Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Guido van Rossum
Hm. It sounds like your company would be better off developing a library of handy tools that it uses over and over, instead of on the one hand using only standard library, and then if the standard library doesn't provide the feature you need, proposing a patch. I wouldn't be so critical if I thoug

Re: [Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Brad Doctor
Because it is a great way to consistently use popen().  Rather than write something specific each time, our site/company prefers to use commands to keep it all consistent.-brad On 7/5/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: Since commands.getstatusoutput() is such a trivial wrapper aroundos

Re: [Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Guido van Rossum
Since commands.getstatusoutput() is such a trivial wrapper around os.popen(), why bother patching commands.py? On 7/5/06, Brad Doctor <[EMAIL PROTECTED]> wrote: > Greetings all, > > I have attached a patch for commands.py to provide a callback ability. > Example use: > > --

Re: [Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Brad Doctor
Cool, thank you Fredrik -- going there now.-bradOn 7/5/06, Fredrik Lundh <[EMAIL PROTECTED] > wrote:Brad Doctor wrote:> I am not sure if this is the proper forum or means to submit something > like this, so please forgive me and advise accordingly if I am in error.to make sure that they don't just

Re: [Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Fredrik Lundh
Brad Doctor wrote: > I am not sure if this is the proper forum or means to submit something > like this, so please forgive me and advise accordingly if I am in error. to make sure that they don't just disappear under a zillion other mails, patches should be submitted to the patch tracker:

[Python-Dev] Patch for commands.py to provide callback

2006-07-05 Thread Brad Doctor
Greetings all,I have attached a patch for commands.py to provide a callback ability.  Example use:-import commandscmd = 'top -b -n2'def fancy(out):     print 'GOT(%s)' % out.strip()commands.cb = fancy(s,o) = commands.getstatusoutput(cmd)print 'OUTPUT (%s)' % o---