On Dec 14, 2009, at 11:31 PM, Chris McCormick wrote:
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.
Hanging as in not responding, but not quitting. I guess bang/until
would do that. Its tricky to catch. I guess there needs to be some
kind of ping.
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.
The advantage of this using PyPd for the unittest scripts is that PyPd
becomes more robust in the process. The only issue in my mind is
whether PyPd has the same goal in terms of monitoring the pd process.
I can't see why not, but I suppose there could be a reason.
.hc
Looking at things from a more basic level, you can come up with a more
direct solution... It may sound small in theory, but it in practice,
it can change entire economies. - Amy Smith