All pastes #35277 Raw Edit

Stuff

public python v1 · immutable
#35277 ·published 2005-12-30 14:45 UTC
rendered paste body
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")		self.sieve = subprocess.Popen(self.command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)		while 1:			if(self.runclient == True):				line = self.sieve.stdout.readline()				sys.stdout.write(line)				gtk.threads_enter()				self.parent.ReadSiever(line)				if not line:					break				gtk.threads_leave()			else:				sys.stdout.write("Closing")				self.sieve.stdout.close()				self.sieve.stdin.close()				break	def stop(self):		sys.stdout.write("Set Close Flag")		self.runclient = False