#NEWLINE# def command( engine , format , filepath = None ) : #NEWLINE# #INDENT# 'Return args list for subprocess.Popen and name of the rendered file.' #NEWLINE# if ( engine not in ENGINES ) : #NEWLINE# #INDENT# raise ValueError ( ( 'unknown engine: %r' % engine ) ) #NEWLINE# #UNINDENT# if ( format not in FORMATS ) : #NEWLINE# #INDENT# raise ValueError ( ( 'unknown format: %r' % format ) ) #NEWLINE# #UNINDENT# ( args , rendered ) = ( [ engine , ( '-T%s' % format ) ] , None ) #NEWLINE# if ( filepath is not None ) : #NEWLINE# #INDENT# args . extend ( [ '-O' , format ] ) #NEWLINE# rendered = ( '%s.%s' % ( filepath , format ) ) #NEWLINE# #UNINDENT# return ( args , rendered )