Reworked script service, added cloning terminals to all cloning facilities

This commit is contained in:
Light2
2013-09-16 16:42:30 +02:00
parent f6ce41e1e1
commit 351f1d6bd4
19 changed files with 128 additions and 31 deletions
+26 -10
View File
@@ -39,43 +39,59 @@ public class ScriptService {
}
public void callScript(String path, String module, String method) {
PythonInterpreter interpreter = new PythonInterpreter();
/*PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
func.__call__(Py.java2py(core));
func.__call__(Py.java2py(core));*/
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
python.get(method).__call__();
}
public void callScript(String path, String module, String method, Object arg1) {
PythonInterpreter interpreter = new PythonInterpreter();
/*PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
func.__call__(Py.java2py(core), Py.java2py(arg1));
func.__call__(Py.java2py(core), Py.java2py(arg1));*/
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
python.get(method).__call__(Py.java2py(arg1));
}
public void callScript(String path, String method, String module, Object arg1, Object arg2) {
PythonInterpreter interpreter = new PythonInterpreter();
/*PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
func.__call__(Py.java2py(arg1), Py.java2py(arg2));
func.__call__(Py.java2py(arg1), Py.java2py(arg2));*/
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2));
}
public void callScript(String path, String method, String module, Object arg1, Object arg2, Object arg3) {
PythonInterpreter interpreter = new PythonInterpreter();
/*PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3));
func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3));*/
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3));
}
public void callScript(String path, String module, String method, Object arg1, Object arg2, Object arg3, Object arg4) {
PythonInterpreter interpreter = new PythonInterpreter();
/*PythonInterpreter interpreter = new PythonInterpreter();
interpreter.cleanup();
interpreter.exec("import sys\nsys.path.append('" + path + "')\nfrom " + module + " import " + method);
PyObject func = interpreter.get(method);
func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3), Py.java2py(arg4));
func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3), Py.java2py(arg4));*/
PythonInterpreter python = new PythonInterpreter();
python.execfile(path + module + ".py");
python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3), Py.java2py(arg4));
}
public PyObject getMethod(String path, String module, String method) {