#NEWLINE# def convertFile( filename , outputter , template , ext = '.mgp' ) : #NEWLINE# #INDENT# fout = open ( ( os . path . splitext ( filename ) [ 0 ] + ext ) , 'w' ) #NEWLINE# fout . write ( open ( template ) . read ( ) ) #NEWLINE# spitter = outputter ( spitter . write , os . path . dirname ( filename ) , filename ) #NEWLINE# fin = open ( filename ) #NEWLINE# processFile ( spitter , fin ) #NEWLINE# fin . close ( ) #NEWLINE# fout . close ( )