<s> import os <EOL> import commander <EOL> class DxInterface : <EOL> def __init__ ( self , javaPath = "<STR_LIT>" , javaOpts = "<STR_LIT>" , pathDx = "<STR_LIT>" , jarDx = "<STR_LIT>" ) : <EOL> self . javaPath = javaPath <EOL> self . javaOpts = javaOpts <EOL> self . pathDx = pathDx <EOL> self . jarDx = jarDx <EOL> def _previewDexCmd ( self , action , options ) : <EOL> path = os . path . join ( self . pathDx , self . jarDx ) <EOL> cmd = "<STR_LIT>" % ( path , action , options ) <EOL> return cmd <EOL> def _interpResultsDexCmd ( self , returnCode , outputStr ) : <EOL> retCode = "<STR_LIT>" % returnCode <EOL> if returnCode : <EOL> output = "<STR_LIT>" % ( retCode , outputStr ) <EOL> return ( False , output ) <EOL> return ( True , None ) <EOL> def dex ( self , inFiles , output , noLocals = False ) : <EOL> """<STR_LIT>""" <EOL> options = "<STR_LIT>" <EOL> if noLocals : <EOL> options += "<STR_LIT>" <EOL> options += "<STR_LIT>" + output + "<STR_LIT:'>" <EOL> options += "<STR_LIT:U+0020>" <EOL> for inFile in inFiles : <EOL> options += "<STR_LIT:'>" + inFile + "<STR_LIT>" <EOL> dexCmd = self . _previewDexCmd ( "<STR_LIT>" , options ) <EOL> ( result_code , outputStr ) = self . _runDxCommand ( dexCmd ) <EOL> return self . _interpResultsDexCmd ( result_code , outputStr ) <EOL> def _runDxCommand ( self , commandString ) : <EOL> cmd = "<STR_LIT>" % ( self . javaPath , self . javaOpts , commandString ) <EOL> return commander . runOnce ( cmd ) </s>
