On Mon, Dec 14, 2009 at 10:50:44PM -0500, Hans-Christoph Steiner wrote:
This looks quite useful. Is the process management pretty robust? I
have a big python script for running help patches and unit tests. It
mostly works quite well, but occasionally there is some weird bug in a
patch that causes the pd process to hang without notification.
I guess it depends how the pd process is "hanging". If it's a proper crash then Pd.py will fire a callback method which you can override. I have never had the pd process just hang ( [bang( -> [until]? ) before so I don't know how it would react. Maybe I should test that.
Here's my script:
http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/scripts/load_eve...
Looks good.
I suppose this script should use PyPd.
Well, I don't know. If it works well now then why change it? :)
I don't actually use the subprocess module, rather a Popen, which is probably a mistake. That's probably because I started it before the subprocess module was available. I like how you are auto-generating the netreceive patch. I am just including it in the patches/ subdirectory. I guess my way gives the author flexibility to use [python-interface] in their own patch as a singleton for communicating with Python.
Basically because you know your script better I think it would be a good idea to stick with it until there is a compelling reason to change and learn something new.
We are using it primarily for managing a long-running Pd process rather than a one-shot unit test. Maybe your script is more sensible for tests which just fire and then exit immediately.
Chris.