class runsieve(Thread): def __init__ (self,command,parent): Thread.__init__(self) self.parent = parent self.command = command self.runclient = True def run(self): sys.stdout.write("Creating process\n") self.sieve = subprocess.Popen(self.command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) while self.runclient == True: line = self.sieve.stdout.readline() if not line: break else: gtk.threads_enter() self.parent.ReadSiever(line) gtk.threads_leave() sys.stdout.write("Closing\n") self.sieve.stdout.close() self.sieve.stdin.close() def stop(self): sys.stdout.write("Set Close Flag\n") self.runclient = False