Set python.path properly from within the jython extension
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1920 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
1e2af79851
commit
d5a742944e
@ -32,8 +32,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
function init() {
|
||||
// Packages.java.lang.System.err.println("Initializing jython extension");
|
||||
|
||||
var libPath = new Packages.java.io.File(module.getPath(), "MOD-INF/lib/jython/").getCanonicalPath();
|
||||
|
||||
var S = Packages.java.lang.System;
|
||||
var currentLibPath = S.getProperty("python.path");
|
||||
if (currentLibPath == null) {
|
||||
currentLibPath = libPath;
|
||||
} else if (currentLibPath.indexOf(libPath) < 0) {
|
||||
currentLibPath = currentLibPath + Packages.java.io.File.pathSeparator + libPath;
|
||||
}
|
||||
S.setProperty("python.path", currentLibPath);
|
||||
|
||||
Packages.com.google.refine.expr.MetaParser.registerLanguageParser(
|
||||
"jython",
|
||||
"Jython",
|
||||
|
7
refine
7
refine
@ -910,13 +910,6 @@ if [ -z "$REFINE_VERBOSITY" ] ; then
|
||||
fi
|
||||
add_option "-Drefine.verbosity=$REFINE_VERBOSITY"
|
||||
|
||||
if [ -z "$JYTHONPATH" ] ; then
|
||||
JYTHONPATH="$REFINE_WEBAPP/WEB-INF/lib/jython"
|
||||
else
|
||||
JYTHONPATH="$REFINE_WEBAPP/WEB-INF/lib/jython${SEP}$JYTHONPATH"
|
||||
fi
|
||||
add_option "-Dpython.path=$JYTHONPATH"
|
||||
|
||||
# ----- Respond to the action given --------------------------------------------
|
||||
|
||||
case "$ACTION" in
|
||||
|
@ -94,11 +94,6 @@ public class Refine {
|
||||
|
||||
// tell the signpost library to log
|
||||
//System.setProperty("debug","true");
|
||||
|
||||
// if not already set, make sure jython can find its python stuff
|
||||
if (System.getProperty("python.path") == null) {
|
||||
System.setProperty("python.path","lib/python");
|
||||
}
|
||||
|
||||
// set the log verbosity level
|
||||
org.apache.log4j.Logger.getRootLogger().setLevel(Level.toLevel(Configurations.get("refine.verbosity","info")));
|
||||
|
Loading…
Reference in New Issue
Block a user