Package nz.org.riskscape.cpython
Class CPythonSettings
java.lang.Object
nz.org.riskscape.cpython.CPythonSettings
Encapsulates some higher level logic around the configured python environment
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
checkPython3Working
(nz.org.riskscape.problem.ProblemSink problemSink) Runs a few checks to get some confidence that our cpython adaptor is going to work properly, logging errors to problemSinkstatic CPythonSettings
Returns default settings from just the plugin's library dir and the path to a python interpreterboolean
static CPythonSettings
Build settings from the giveniniSection
configint
int
hashCode()
boolean
toString()
-
Field Details
-
DEFAULT_ADAPTOR_PATH
- See Also:
-
DEFAULT_PYTHON3_OPTIONS
- See Also:
-
NOT_SET
- See Also:
-
-
Constructor Details
-
CPythonSettings
public CPythonSettings()
-
-
Method Details
-
defaults
Returns default settings from just the plugin's library dir and the path to a python interpreter
-
fromIniSection
public static CPythonSettings fromIniSection(Path pluginInstallPath, Map<String, List<String>> iniSection) Build settings from the given
iniSection
config- Parameters:
pluginInstallPath
- filesystem path to plugin's installed resources
-
isPython3BinSet
public boolean isPython3BinSet()- Returns:
- true if the user has setup python3-bin or we've successfully found python at the default location. Later on we do some more thorough checks that python is working, and it doesn't make sense to do those checks if the user just has the CPython plugin installed because riskscape shipped with it on by default.
-
checkPython3Working
public boolean checkPython3Working(nz.org.riskscape.problem.ProblemSink problemSink) Runs a few checks to get some confidence that our cpython adaptor is going to work properly, logging errors to problemSink
-
newPython3Command
- Returns:
- the beginning of a command that can be used to invoke python3, with options but without the adaptor script
-
getPython3Bin
-
getAdaptorPath
-
getPython3Options
-
getLibDir
-
getMaxProcessesPerFunction
public int getMaxProcessesPerFunction() -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-