Class 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 Detail

      • PythonUtil

        public PythonUtil()
    • 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.IOException
        java.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.IOException
        java.lang.InterruptedException
      • executeScript

        public java.lang.String executeScript​(java.lang.String script)
                                       throws java.io.IOException,
                                              java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • getInstalledVersion

        public java.lang.String getInstalledVersion()
                                             throws java.io.IOException,
                                                    java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • isInstalledVersionCompatible

        public boolean isInstalledVersionCompatible​(int reqRel,
                                                    int reqMaj,
                                                    int reqMin)
                                             throws java.io.IOException,
                                                    java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • areAllGivenModuleInstalled

        public boolean areAllGivenModuleInstalled​(java.util.List<java.lang.String> modules)
                                           throws java.io.IOException,
                                                  java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • isSingleModuleInstalled

        public boolean isSingleModuleInstalled​(java.lang.String moduleName)
                                        throws java.io.IOException,
                                               java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.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.IOException
        java.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.IOException
        java.lang.InterruptedException
      • isModuleInstalled

        public boolean isModuleInstalled​(java.lang.String... modules)
                                  throws java.io.IOException,
                                         java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • getLoggerName

        public java.lang.String getLoggerName()
        Specified by:
        getLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
      • setLoggerName

        public void setLoggerName​(java.lang.String name)
        Specified by:
        setLoggerName in interface org.api4.java.common.control.ILoggingCustomizable