#NEWLINE# def do_compile( self ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# ( filename , view , data ) = self . queue . get ( ) #NEWLINE# try : #NEWLINE# #INDENT# print ( ( '-> compiling %s' % filename ) ) #NEWLINE# dirname = os . path . dirname ( filename ) #NEWLINE# flyname = ( 'flymake_' + os . path . basename ( filename ) ) #NEWLINE# target_name = os . path . join ( dirname , flyname ) #NEWLINE# print ( ( "flymake `%s'" % target_name ) ) #NEWLINE# target = open ( target_name , 'w' ) #NEWLINE# target . truncate ( ) #NEWLINE# target . write ( data ) #NEWLINE# target . close ( ) #NEWLINE# args = [ 'goflymake' , flyname ] #NEWLINE# env = getenv ( ) #NEWLINE# p = openProcess ( args , cwd = dirname , env = env , stdout = subprocess . PIPE , stderr = subprocess . PIPE , stdin = subprocess . PIPE ) #NEWLINE# ( stdout , stderr ) = p . communicate ( ) #NEWLINE# os . unlink ( target_name ) #NEWLINE# sublime . set_timeout ( ( lambda view = view , code = p . returncode : self . show_results ( view , code , stdout , stderr ) ) , 0 ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# print ( ( 'compilation aborted: %s' % filename ) ) #NEWLINE# #UNINDENT# self . lock . acquire ( True ) #NEWLINE# del self . targets [ filename ] #NEWLINE# print ( ( '<- compiling %s - targets=%s' % ( filename , env . targets ) ) ) #NEWLINE# self . lock . release ( ) #NEWLINE# self . queue . task_done ( )