diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
commit | 0ed7a8b68dd73e2b0473b8127aeca99f3bac9061 (patch) | |
tree | 5c67818b38a5cc2f9caa5ca7f8640ca356adf02b /externals/grill/py/scripts/threads.py | |
parent | bb4c7f6a245394d09dac9adfb2efb093d3d98452 (diff) |
cleaned up grill externals - replaced with svn:externals to svn.grrrr.org/ext/trunk/
svn path=/trunk/; revision=10951
Diffstat (limited to 'externals/grill/py/scripts/threads.py')
-rw-r--r-- | externals/grill/py/scripts/threads.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/externals/grill/py/scripts/threads.py b/externals/grill/py/scripts/threads.py deleted file mode 100644 index b0299101..00000000 --- a/externals/grill/py/scripts/threads.py +++ /dev/null @@ -1,50 +0,0 @@ -# py/pyext - python script objects for PD and MaxMSP -# -# Copyright (c) 2002-2003 Thomas Grill (xovo@gmx.net) -# For information on usage and redistribution, and for a DISCLAIMER OF ALL -# WARRANTIES, see the file, "license.txt," in this distribution. -# - -"""This is an example script for the py/pyext object's threading functionality. - -For threading support pyext exposes several function and variables - -- _detach([0/1]): by enabling thread detaching, threads will run in their own threads -- _priority(prio+-): you can raise or lower the priority of the current thread -- _stop({wait time in ms}): stop all running threads (you can additionally specify a wait time in ms) -- _shouldexit: this is a flag which indicates that the running thread should terminate - -""" - -try: - import pyext -except: - print "ERROR: This script must be loaded by the PD/Max pyext external" - -from time import sleep - -################################################################# - -class ex1(pyext._class): - """This is a simple class with one method looping over time.""" - - # number of inlets and outlets - _inlets=2 - _outlets=2 - - sltime=0.1 # sleep time - loops=20 # loops to iterate - - # method for bang to any inlet - def bang_(self,n): - for i in xrange(self.loops): - # if _shouldexit is true, the thread ought to stop - if self._shouldexit: - print "BREAK" - break - - self._outlet(n,i) - sleep(self.sltime) - - - |