Class PythonUtils
java.lang.Object
de.iip_ecosphere.platform.tools.maven.python.PythonUtils
Some generic python process helper functions. For now taken over to keep this plugin on Java 8.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileReturns the Python executable.static FilegetPythonExecutable(String pythonBinary) Returns the Python executable.static voidsetPythonExecutable(File exec) Defines the (global) Python executable.
-
Field Details
-
DEFAULT_PYTHON_EXECUTABLE
-
pythonExecutable
-
-
Constructor Details
-
PythonUtils
public PythonUtils()
-
-
Method Details
-
setPythonExecutable
Defines the (global) Python executable.- Parameters:
exec- the executable, may be null for dynamically determined
-
getPythonExecutable
Returns the Python executable. We consider the following precedences:- Local python3 in Linux Jenkins installation (for testing, although this is production code; with installation path)
- Local python3 in default Linux installation ("/usr/bin", with installation path)
- The global python executable
setPythonExecutable(File)(with installation path) - The command "python"
- Returns:
- the executable, returns at least "python"; the result may be an absolute path but must not be. Calling
File.getAbsolutePath()on the result may be misleading - if required, use it as string.
-
getPythonExecutable
Returns the Python executable. We consider the following precedences:- Local python3 in Linux Jenkins installation (for testing, although this is production code; with installation path)
- Local python3 in default Linux installation ("/usr/bin", with installation path)
- The global python executable
setPythonExecutable(File)(with installation path) - The command "python"
- Parameters:
pythonBinary- explicitly given path to python binary- Returns:
- the executable, returns at least "python"; the result may be an absolute path but must not be. Calling
File.getAbsolutePath()on the result may be misleading - if required, use it as string.
-