#NEWLINE# def run_command( self , cmd , **kwargs ) : #NEWLINE# #INDENT# p = subprocess . Popen ( cmd , stdout = subprocess . PIPE , stderr = subprocess . PIPE , ** kwargs ) #NEWLINE# t1 = threading . Thread ( target = self . reader , args = ( p . stdout , 'stdout' ) ) #NEWLINE# t1 . start ( ) #NEWLINE# t2 = threading . Thread ( target = self . reader , args = ( p . stderr , 'stderr' ) ) #NEWLINE# t2 . start ( ) #NEWLINE# p . wait ( ) #NEWLINE# t1 . join ( ) #NEWLINE# t2 . join ( ) #NEWLINE# if ( self . progress is not None ) : #NEWLINE# #INDENT# self . progress ( 'done.' , 'main' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . verbose : #NEWLINE# #INDENT# sys . stderr . write ( 'done.\n' ) #NEWLINE# #UNINDENT# #UNINDENT# return p