#NEWLINE# def ConvertInoToCpp( env ) : #NEWLINE# #INDENT# def delete_tmpcpp_file( file_ ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# remove ( file_ ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# if isfile ( file_ ) : #NEWLINE# #INDENT# print ( ( "Warning: Could not remove temporary file '%s'. Please remove it manually." % file_ ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# ino_nodes = ( env . Glob ( join ( '$PROJECTSRC_DIR' , '*.ino' ) ) + env . Glob ( join ( '$PROJECTSRC_DIR' , '*.pde' ) ) ) #NEWLINE# c = InoToCPPConverter ( ino_nodes ) #NEWLINE# data = c . convert ( ) #NEWLINE# if ( not data ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# tmpcpp_file = join ( env . subst ( '$PROJECTSRC_DIR' ) , 'tmp_ino_to.cpp' ) #NEWLINE# with open ( tmpcpp_file , 'w' ) as f : #NEWLINE# #INDENT# f . write ( c ) #NEWLINE# #UNINDENT# atexit . register ( delete_tmpcpp_file , tmpcpp_file )