some stuff I forgot to commit

This commit is contained in:
Light2
2013-10-29 15:48:54 +01:00
parent ca5aae4187
commit 7ae910431d
8 changed files with 172 additions and 16 deletions
+3 -4
View File
@@ -95,10 +95,9 @@ public class ScriptService {
}
public PyObject getMethod(String path, String module, String method) {
PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
PyObject func = python.get(method);
return func;
}