#NEWLINE# def _generate_graph( self , item , output ) : #NEWLINE# #INDENT# 'generates a single graph' #NEWLINE# s = models [ item [ 0 ] ] ( self . data , list ( item [ 1 ] ) ) #NEWLINE# gnuplot_script = s ( ) #NEWLINE# output_line = ( "set output '%s'\n" % output ) #NEWLINE# gnuplot_script = ( output_line + gnuplot_script ) #NEWLINE# ( fd , filename ) = mkstemp ( text = True ) #NEWLINE# f = open ( filename , 'w' ) #NEWLINE# f . write ( gnuplot_script ) #NEWLINE# f . close ( ) #NEWLINE# os . close ( fd ) #NEWLINE# cmd = subprocess . Popen ( ( 'gnuplot %s' % filename ) , shell = True , stdout = subprocess . PIPE )