Now I have basic functionality pushed to trunk.

If you want to "spawn" (posibbly several) system commands to background,
use g.procs.add(), like this ctrl+b script:

def L(*args):
    g.es("callback", args)

g.procs.add(['sleep', '4'], "que1")
g.procs.add(['sleep', '3'], "que1", L)
g.procs.add(['sleep', '2'], "que1")
g.procs.add(['sleep', '2'], "que2")

Note how que2 completes first. Idea is that commands in same queue depend
on each other, and thus need to run in sequential order.

This should make waiting for long lasting operations easier as the whole
Leo won't freeze until they are over (but you can still use the stdout /
stderr output from these calls, thanks to the optional callback)

API may change once I start using it (soon).



On Wed, Apr 17, 2013 at 2:48 PM, Ville M. Vainio <[email protected]> wrote:

> Often, I find myself wanting to execute system commands in serial fashion
> (first in, first out), capture their output, and allow browsing it, BUT not
> blocking Leo or ipython terminal.
>
> I'd like to show stderr and stdout in g.es, or separate log page, and
> provide callback after task has been completed.
>
> Unless anyone has something like this already, I plan to create it "later"
> with QProcess.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to