#NEWLINE# def run( self ) : #NEWLINE# #INDENT# ' Start the process and hook up the callbacks.\n        ' #NEWLINE# env = os . environ #NEWLINE# env [ 'TERM' ] = 'xterm' #NEWLINE# process = Popen ( ( self . command_string + ' 2>&1' ) , shell = True , env = env , universal_newlines = True , stdout = PIPE , stdin = PIPE ) #NEWLINE# self . process = process #NEWLINE# while True : #NEWLINE# #INDENT# out_char = process . stdout . read ( 1 ) #NEWLINE# if ( out_char == '' ) : #NEWLINE# #INDENT# if ( process . poll ( ) is not None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sleep ( 0.1 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . out_callback ( out_char ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . end_callback is not None ) : #NEWLINE# #INDENT# self . end_callback ( )