Skip to content

Commit 4ec7292

Browse files
committed
Removed pythonLocation entirely from code and changed to pythonExecutable
1 parent 301c557 commit 4ec7292

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test {
9494
println("Running tests with python: ${pythonExecutable}")
9595
println("Running tests in directory: ${userDir}")
9696
environment 'spring.config.location', applicationProperties
97-
environment 'pythonLocation', pythonExecutable
97+
environment 'pythonExecutable', pythonExecutable
9898
useJUnitPlatform()
9999
testLogging.showStandardStreams = true
100100
}

src/main/java/edu/kit/datamanager/mappingservice/configuration/ApplicationProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public class ApplicationProperties {
4343
* The absolute path to the python interpreter.
4444
*/
4545
@ExecutableFileURL
46-
@Value("${mapping-service.pythonLocation}")
47-
private URL pythonLocation;
46+
@Value("${mapping-service.pythonExecutable}")
47+
private URL pythonExecutable;
4848

4949
/**
5050
* The absolute path where the plugins are stored.

src/main/java/edu/kit/datamanager/mappingservice/util/PythonRunnerUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public static MappingPluginState runPythonScript(String script, String... args)
8989
* @throws MappingPluginException if an error occurs.
9090
*/
9191
public static MappingPluginState runPythonScript(String script, OutputStream output, OutputStream error, String... args) throws MappingPluginException {
92-
if (configuration == null || configuration.getPythonLocation() == null) return MappingPluginState.UNKNOWN_ERROR;
92+
if (configuration == null || configuration.getPythonExecutable()== null) return MappingPluginState.UNKNOWN_ERROR;
9393
ArrayList<String> command = new ArrayList<>();
94-
command.add(configuration.getPythonLocation().getPath());
94+
command.add(configuration.getPythonExecutable().getPath());
9595
command.add(script);
9696
Collections.addAll(command, args);
9797
ShellRunnerUtil.run(output, error, command.toArray(new String[0]));

src/test/resources/test-config/application-test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spring.jpa.hibernate.ddl-auto=update
4848
# Mapping-Service specific settings
4949
##################################################
5050
# Absolute path to the local python interpreter
51-
mapping-service.pythonLocation=${pythonExecutable:'file:///usr/bin/python3'}
51+
mapping-service.pythonExecutable=${pythonExecutable:'file:///usr/bin/python3'}
5252
# Absolute path to the folder where all plugins are located
5353
mapping-service.pluginLocation=file:///${user.dir}/plugins
5454
# Absolute path to the local gemma mappings folder

0 commit comments

Comments
 (0)