Skip to content

Commit a3d0cda

Browse files
committed
Fixed problems with python
1 parent c83b1b4 commit a3d0cda

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/main/java/edu/kit/datamanager/python/util/PythonUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public static int run(String pythonLocation, String scriptLocation, OutputStream
149149

150150
int result = 4711;
151151
try {
152+
152153
ProcessBuilder pb = new ProcessBuilder(command.toArray(new String[]{}));
153154
Process p = pb.start();
154155

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ repo.audit.enabled:true
9696
# Absolute path to the local python interpreter
9797
repo.plugin.gemma.pythonLocation:/usr/local/bin/python3
9898
# Absolute path to the local gemma mapping script mapping_single.py'
99-
repo.plugin.gemma.gemmaLocation:/Users/pfeil/git/gemma/mapping_single.py
99+
repo.plugin.gemma.gemmaLocation:/Users/maximilian/Documents/GitHub/mapping-service/src/test/resources/python/mapping_single.py
100100
# Absolute path to the local gemma mappings folder
101101
repo.plugin.gemma.mappingsLocation:/Users/pfeil/git/gemma-plugin/mappings
102102
# List of schema mappings containing the content type as key in squared brackets and the

src/test/java/edu/kit/datamanager/indexer/mapping/MappingUtilTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public static void setUpClass() throws IOException {
7171
}
7272
System.out.println("Location of python: " + pythonExecutable);
7373
PYTHON_EXECUTABLE = new File(pythonExecutable.trim()).getAbsoluteFile().toURI().toURL();
74+
// PYTHON_EXECUTABLE = new File("/opt/homebrew/bin/python3".trim()).getAbsoluteFile().toURI().toURL();
7475
GEMMA_CLASS = new URL("file:src/test/resources/python/mapping_single.py");
7576
}
7677

src/test/resources/python/invalid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22

33

44
print "Not allowed"

src/test/resources/python/mapping_single.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
output_filename = sys.argv[3]
1818
#output_filename = "output.json"
1919

20-
2120
print("\n \n \n MAPPING DOCUMENT: {} \n \n \n".format(input_file))
22-
mapping_functions.map_response(schema, input_file, output_filename)
23-
24-
21+
mapping_functions.map_response(schema, input_file, output_filename)

src/test/resources/python/printOutput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
import time
33
import sys
44

src/test/resources/python/sleep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
import time
33

44
print ("Sleep for 3 seconds")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ metastore.indexer.mappingsLocation:file:///tmp/metastore2/mapping
3535
######################## Configuration for GEMMA #########################
3636
# Absolute path to the local python interpreter
3737
metastore.indexer.gemma.pythonLocation:file:///usr/bin/python3
38+
3839
# Path to the local gemma mapping script mapping_single.py' (may be absolute or relative)
3940
metastore.indexer.gemma.gemmaLocation:file:src/test/resources/python/mapping_single.py
4041

0 commit comments

Comments
 (0)