def run(self): """main worker loop""" self.output('started') self.buildUp() while True: # check for messages try: msg = self.InQueue.get_nowait() if Debug: self.output('received ' + str(msg)) exec('self.{0}(*{1})'.format(msg[0],msg[1:])) except Queue.Empty: pass self.loop() # Check if main thread is ready to stop if QuitinTime.wait(2): self.tearDown() self.output('Quitin\'') return