-
Notifications
You must be signed in to change notification settings - Fork 5
Notes on Jython Support_137200178
nxi edited this page Apr 9, 2015
·
1 revision
Created by Tony Lam, last modified on Jan 06, 2010
As request by issue GUMTREE-130, we are looking at a way to integrate Jython into GumTree. The initial integration via the GumTree scripting API was very smooth (no addition code is required to bind with GumTree), and it also works well with calling Java classes inside the OSGi container. However, it does not print any result back to the writer after a script is executed.
The problem was the implementation of the JSR223 Jython script engine. It uses a different compilation procedure than the one in interactive mode (see: org.python.util.InteractiveConsole.push(String)). It means when the compiled function is executed, org.python.core.Py.printResult(PyObject) will not be called to prompt the result.
The solution to this problem is to modify the eval(String, ScriptContext) method for org.python.jsr223.PyScriptEngine, which we call runsource(String, String) directly from org.python.util.InteractiveInterpreter.
Document generated by Confluence on Apr 01, 2015 00:11
Home | Developer Guide | Copyright © 2013 ANSTO