#NEWLINE# def run( self , clean = True ) : #NEWLINE# #INDENT# '\n        Create a temporary file and run it\n        ' #NEWLINE# template = self . template #NEWLINE# parameters = self . parameters #NEWLINE# fw = must_open ( 'tmp' , 'w' ) #NEWLINE# path = fw . name #NEWLINE# fw . write ( template . safe_substitute ( ** parameters ) ) #NEWLINE# fw . close ( ) #NEWLINE# sh ( ( 'Rscript %s' % path ) ) #NEWLINE# if clean : #NEWLINE# #INDENT# os . remove ( path ) #NEWLINE# rplotspdf = 'Rplots.pdf' #NEWLINE# if op . exists ( rplotspdf ) : #NEWLINE# #INDENT# os . remove ( rplotspdf )