#NEWLINE# def write_procpar( filename , dic , overwrite = False ) : #NEWLINE# #INDENT# '\n    Write a Agilent/Varian procpar file from a dictionary\n    ' #NEWLINE# f = fileiobase . open_towrite ( filename , overwrite = overwrite , mode = 'w' ) #NEWLINE# for key in dic . keys ( ) : #NEWLINE# #INDENT# d = dic [ key ] #NEWLINE# print ( d [ 'name' ] , d [ 'subtype' ] , d [ 'basictype' ] , d [ 'maxvalue' ] , d [ 'minvalue' ] , d [ 'stepsize' ] , d [ 'Ggroup' ] , d [ 'Dgroup' ] , d [ 'protection' ] , d [ 'active' ] , d [ 'intptr' ] , file = f ) #NEWLINE# if ( d [ 'basictype' ] == '1' ) : #NEWLINE# #INDENT# print ( len ( d [ 'values' ] ) , end = ' ' , file = overwrite ) #NEWLINE# for value in d [ 'values' ] : #NEWLINE# #INDENT# print ( value , end = ' ' , file = f ) #NEWLINE# #UNINDENT# print ( '' , file = f ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d [ 'basictype' ] == '2' ) : #NEWLINE# #INDENT# print ( len ( d [ 'values' ] ) , end = ' ' , file = f ) #NEWLINE# for value in d [ 'values' ] : #NEWLINE# #INDENT# print ( ( ( '"' + value ) + '"' ) , file = f ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# print ( d [ 'enumerable' ] , end = ' ' , file = f ) #NEWLINE# if ( d [ 'enumerable' ] != '0' ) : #NEWLINE# #INDENT# for e in d [ 'enumerables' ] : #NEWLINE# #INDENT# if ( d [ 'basictype' ] == '1' ) : #NEWLINE# #INDENT# print ( e , end = ' ' , file = f ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( d [ 'basictype' ] == '2' ) : #NEWLINE# #INDENT# print ( ( ( '"' + e ) + '"' ) , end = ' ' , file = f ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# print ( '' , file = f ) #NEWLINE# #UNINDENT# f . close ( ) #NEWLINE# return