Package ai.libs.python
Class PythonUtil
- java.lang.Object
-
- ai.libs.python.PythonUtil
-
- All Implemented Interfaces:
org.api4.java.common.control.ILoggingCustomizable
public class PythonUtil extends java.lang.Object implements org.api4.java.common.control.ILoggingCustomizable
-
-
Constructor Summary
Constructors Constructor Description PythonUtil()PythonUtil(IPythonConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareAllGivenModuleInstalled(java.util.List<java.lang.String> modules)java.lang.StringexecuteScript(java.lang.String script)intexecuteScriptFile(java.util.List<java.lang.String> fileAndParams)java.lang.StringexecuteScriptFileAndGetOutput(java.util.List<java.lang.String> fileAndParams)java.lang.String[]getExecutableCommandArray(boolean executePythonInteractive, java.lang.String... command)java.lang.StringgetInstalledVersion()java.lang.StringgetLoggerName()java.util.List<java.lang.String>getMissingModules(java.lang.String... modules)java.util.List<java.lang.String>getMissingModules(java.util.List<java.lang.String> modules)booleanisInstalledVersionCompatible(int reqRel, int reqMaj, int reqMin)booleanisModuleInstalled(java.lang.String... modules)booleanisSingleModuleInstalled(java.lang.String moduleName)voidsetLoggerName(java.lang.String name)
-
-
-
Constructor Detail
-
PythonUtil
public PythonUtil()
-
PythonUtil
public PythonUtil(IPythonConfig config)
-
-
Method Detail
-
getExecutableCommandArray
public java.lang.String[] getExecutableCommandArray(boolean executePythonInteractive, java.lang.String... command)
-
executeScriptFile
public int executeScriptFile(java.util.List<java.lang.String> fileAndParams) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
executeScriptFileAndGetOutput
public java.lang.String executeScriptFileAndGetOutput(java.util.List<java.lang.String> fileAndParams) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
executeScript
public java.lang.String executeScript(java.lang.String script) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
getInstalledVersion
public java.lang.String getInstalledVersion() throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
isInstalledVersionCompatible
public boolean isInstalledVersionCompatible(int reqRel, int reqMaj, int reqMin) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
areAllGivenModuleInstalled
public boolean areAllGivenModuleInstalled(java.util.List<java.lang.String> modules) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
isSingleModuleInstalled
public boolean isSingleModuleInstalled(java.lang.String moduleName) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
getMissingModules
public java.util.List<java.lang.String> getMissingModules(java.lang.String... modules) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
getMissingModules
public java.util.List<java.lang.String> getMissingModules(java.util.List<java.lang.String> modules) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
isModuleInstalled
public boolean isModuleInstalled(java.lang.String... modules) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
-