public class PythonScriptExecutor extends PythonExecutorBase
PythonExecutorBase.PythonExecutableNamePYTHON_EXTENSIONexternalScriptExecutableName, ignoreExceptions| Constructor and Description |
|---|
PythonScriptExecutor(boolean ensureExecutableExists) |
PythonScriptExecutor(PythonExecutorBase.PythonExecutableName pythonExecutableName,
boolean ensureExecutableExists) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkPythonEnvironmentForPackage(java.lang.String packageName) |
boolean |
executeArgs(java.util.List<java.lang.String> rawArgs)
Executes the Python executor using the values in
rawArgs |
boolean |
executeCommand(java.lang.String command,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
Execute a python command (-c).
|
boolean |
executeModule(java.lang.String moduleName,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
Execute a python module (-m).
|
boolean |
executeScript(Resource scriptResource,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
Execute a python script from a Resource file.
|
boolean |
executeScript(java.lang.String scriptName,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
Execute a python script.
|
java.lang.String |
getApproximateCommandLine()
Return a (not necessarily executable) string representing the current command line for this executor
for error reporting purposes.
|
getScriptExceptionexecutableMissing, executeCuratedArgs, externalExecutableExists, setIgnoreExceptionspublic PythonScriptExecutor(boolean ensureExecutableExists)
ensureExecutableExists - throw if the python executable cannot be locatedpublic PythonScriptExecutor(PythonExecutorBase.PythonExecutableName pythonExecutableName, boolean ensureExecutableExists)
pythonExecutableName - name of the python executable to startensureExecutableExists - throw if the python executable cannot be foundpublic boolean executeCommand(java.lang.String command,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
command - python command to be executedpythonProcessArgs - args to be passed to the python processscriptArgs - args to be passed to the python codepublic boolean executeModule(java.lang.String moduleName,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
moduleName - name of the module to executepythonProcessArgs - args to be passed to the python processscriptArgs - args to be passed to the python codepublic boolean executeScript(Resource scriptResource, java.util.List<java.lang.String> pythonProcessArgs, java.util.List<java.lang.String> scriptArgs)
scriptResource - Resource for the script to executepythonProcessArgs - args to be passed to the python processscriptArgs - args to be passed to the python codepublic boolean executeScript(java.lang.String scriptName,
java.util.List<java.lang.String> pythonProcessArgs,
java.util.List<java.lang.String> scriptArgs)
scriptName - full path name of the script to executepythonProcessArgs - args to be passed to the python processscriptArgs - args to be passed to the python codepublic boolean executeArgs(java.util.List<java.lang.String> rawArgs)
rawArgsrawArgs - raw command line arguments to be passed to the Python processpublic java.lang.String getApproximateCommandLine()
getApproximateCommandLine in class PythonExecutorBasepublic static void checkPythonEnvironmentForPackage(java.lang.String packageName)