[PD] pyext thread question

altern altern2 at gmail.com
Thu Jun 19 11:59:20 CEST 2008


hi

just working with pyext after long time not using it. Couple of things

First, on PD extended 0.39.3 on linux at least (not sure about the new
pd version) on the docs folder there is a folder manuals/py which only
contains license, readme and an empty folder called scripts. The actual
examples for py are actually located at examples/py
I suggest all could be either in manuals/py or examples/py, in any case
having the empty "script" older is a bit confusing. I thought for a sec
that the docs where just not included with PD extended to later find
them under examples.

Secondly, I am working on a script that needs to be initialised on load
with _detach set to 1. According to the docs I could solve this in PD
passing a message detach 1. This works fine but I need to set this from
Python on initalisation. Again the docs say I should set (class?)
variable _detach = 1. But this does not work for me, it runs as if it
was still set to 0:

class myclass( pyext._class):
	_detach=1
	_outlets=3
	... and so on..


the script example (threading.py) has this documentation on this issue
""" _detach([0/1]): by enabling thread detaching, threads will run in
their own threads
"""
but the pd patch (thread-1.pd) say this takes three valid values (0/1/2)

Finally after some digging in python printing dir(myclass) and
help(myclass) I found that there is a (private?) class function called
_detach that can be used like this
myclassname._detach(self, 1)

using this funtion does not look very good to me (i guess it is
private). On top of this the code is not executed on initialisation, as
i need, but only when the function is called. any ideas on how i can do
this? maybe extending __init__ ? but i am not sure how to do this. I
hope i made myself clear ...

thanks

enrike






More information about the Pd-list mailing list