I think sh is *nix only.
Another nice shell tool I've been looking at is Sarge
http://sarge.readthedocs.org/en/latest/
Fully cross-platform Py3 capable.

However this command looks like a simpler solution, I look forward
to checking it out, I expect I'll be abandoning my home-brew code
for the new '@button make-sphinx' nice.

Thanks,
Kent

On Wed, Oct 16, 2013 at 9:32 AM, Terry Brown <[email protected]> wrote:
> On Wed, 16 Oct 2013 07:18:05 -0700 (PDT)
> "Edward K. Ream" <[email protected]> wrote:
>
>> The g.execute_shell_commands function executes a list of shell commands,
>> each in a separate processes.
>> *Important*: unlike subprocess.call, each command in the list is a separate
>> command (commands are not concatenated).
>
> Don't for get also leo/extensions/sh.py
> http://amoffat.github.io/sh/
>
> Very comfortable interface to command line tools.
>
> Cheers -Terry
>
>> This function waits for each command to complete, unless the command starts
>> with '&'. For example::
>>
>>     g.execute_shell_commands(['echo hello','echo world','&pwd'])
>>
>> Here it is::
>>
>>     def execute_shell_commands(commands,trace = False):
>>         '''
>>         Execute each shell command in a separate process.
>>         Wait for each command to complete, except those starting with '&'
>>         '''
>>         for command in commands:
>>             wait = not command.startswith('&')
>>             if command.startswith('&'): command = command[1:].strip()
>>             if trace: g.trace('wait',wait,'command',command)
>>             proc = subprocess.Popen(command,shell=True)
>>             if wait: proc.communicate()
>>
>> I have used g.execute_shell_command to great effect in @button make-sphinx
>> in LeoDocs.leo.
>> I'll discuss this next in a reply to the thread "@button make-html
>> @key=Alt-period".
>>
>> Edward
>>
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to