2009-12-19 21:38:24 -05:00
|
|
|
#! /usr/bin/python
|
|
|
|
|
|
|
|
# To change this template, choose Tools | Templates
|
|
|
|
# and open the template in the editor.
|
|
|
|
|
|
|
|
__author__="bjschuma"
|
|
|
|
__date__ ="$Dec 19, 2009 9:30:59 PM$"
|
|
|
|
|
|
|
|
|
|
|
|
from threading import Thread
|
|
|
|
|
|
|
|
|
|
|
|
class Needle(Thread):
|
2009-12-19 23:13:50 -05:00
|
|
|
def __init__(self, func, args=None):
|
|
|
|
Thread.__init__(self)
|
2009-12-19 21:38:24 -05:00
|
|
|
self.func = func
|
|
|
|
self.args = args
|
|
|
|
|
|
|
|
|
|
|
|
def run(self):
|
2009-12-19 23:13:50 -05:00
|
|
|
if self.args==None:
|
|
|
|
self.func()
|
|
|
|
else:
|
|
|
|
self.func(self.args)
|