c.save()g.execute_shell_commands(['git -C /Users/wwww/leodata add austin.leo', 'git -C /Users/wwww/leodata commit -mupdates', '&git -C /Users/wwww/leodata push'])
Austin-MacBook-Pro:leodata wangxu$ ps -ef | grep git501 88822 20009 0 2:00AM ttys000 0:00.00 grep git501 88678 88353 0 1:57AM ttys001 0:00.00 (git)501 88683 88353 0 1:57AM ttys001 0:00.00 (git)
Dear Leo Developer,I created one button in Leo, the corresponding script is:c.save()g.execute_shell_commands(['git -C /Users/wwww/leodata add austin.leo', 'git -C /Users/wwww/leodata commit -mupdates', '&git -C /Users/wwww/leodata push'])Basically, it will save the changes and do a git add/commit/push.
Do I need to do something extra in g.execute_shell_commands ?Good question. Sometimes Leo appears to hang (on Windows) after running unit tests with g.execute_shell_commands. For me, a fix is to type a <return> in the console from which Leo is running.I'm not sure what else can be done. The guts of g.execute_shell_commands is just:proc = subprocess.Popen(command, shell=True)
if wait: proc.communicate()You could try experimenting with shell=False, but I doubt that will work.
--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/e81a0a75-f12e-48ea-9bb3-0f81c447df95%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAO5X8CyAVyKbeiLVxOB1JO_H28%2BR8zcg3qnNRjT8o2bkuSNnBQ%40mail.gmail.com.
This is working fine for me now. I don't see zombie processes for the exited background commands anymore. Nice work.
updated to devel 9b6f29d12..93abd72c6, the problem fixed on my MacBook too.Thanks EKR.
I believe that this happens when you accidentally cause an event in the Windows cmd terminal. I'm referring to the terminal from which Leo is launched (i.e., with python -m leo.core.runLeo). It's not only during unit testing. For me, the usual case is that I want to switch to the terminal to see more of the output. I click the mouse in the terminal but accidentally drag it. This hangs Leo. I think it's something about stdin waiting for a keystroke. That's why typing <ENTER> clears it - that terminates the readline on stdin.
... I click the mouse in the terminal but accidentally drag it. This hangs Leo. I think it's something about stdin waiting for a keystroke. That's why typing <ENTER> clears it - that terminates the readline on stdin.