#NEWLINE# def execute( self , command , args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , data = None , input_path = None , output_path = None ) : #NEWLINE# #INDENT# from pulsar.web import routes #NEWLINE# from pulsar.web.framework import build_func_args #NEWLINE# controller = getattr ( routes , command ) #NEWLINE# action = controller . func #NEWLINE# body_args = dict ( body = self . __build_body ( data , input_path ) ) #NEWLINE# args = build_func_args ( action , args . copy ( ) , self . __app_args ( ) , body_args ) #NEWLINE# result = action ( ** args ) #NEWLINE# if ( controller . response_type != 'file' ) : #NEWLINE# #INDENT# return controller . body ( result ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with open ( result_file , 'rb' ) as result_file : #NEWLINE# #INDENT# copy_to_path ( result_file , output_path )