Subversion Repositories SmartDukaan

Rev

Rev 323 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 323 Rev 344
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.util;
4
package in.shop2020.util;
5
 
5
 
-
 
6
import java.util.Properties;
-
 
7
 
6
import org.python.util.PythonInterpreter;
8
import org.python.util.PythonInterpreter;
7
 
9
 
8
/**
10
/**
9
 * Wrapper around work done by Jython scripts
11
 * Wrapper around work done by Jython scripts
10
 * 
12
 * 
11
 * @author naveen
13
 * @author naveen
12
 *
14
 *
13
 */
15
 */
14
public class JythonWrapper {
16
public class JythonWrapper {
15
	
17
	
-
 
18
	static{
-
 
19
		Properties preProps = System.getProperties();
-
 
20
		Properties postProps = new Properties();
-
 
21
		//props.setProperty("python.home","PYTHONPATH");  
-
 
22
		postProps.setProperty("python.path",Utils.JYTHON_SRC_PATH+"/comparisonrules:"+Utils.JYTHON_SRC_PATH+"/irdatarules:"+Utils.JYTHON_SRC_PATH+"/irmetadatarules:"+Utils.JYTHON_SRC_PATH+"/common:"+Utils.JYTHON_SRC_PATH+"/normalizationrules");
-
 
23
		PythonInterpreter.initialize(preProps,postProps,new String[0]);
-
 
24
	}
-
 
25
	
16
	/**
26
	/**
17
	 * Private Python interpreter instance
27
	 * Private Python interpreter instance
18
	 */
28
	 */
19
	protected PythonInterpreter py = null;
29
	protected PythonInterpreter py = null;
20
 
30
 
Line 23... Line 33...
23
	 * Initialises PythonInterpreter instance 
33
	 * Initialises PythonInterpreter instance 
24
	 */
34
	 */
25
	public void initialize() {
35
	public void initialize() {
26
		if(this.py == null) {
36
		if(this.py == null) {
27
			this.py = new PythonInterpreter();
37
			this.py = new PythonInterpreter();
-
 
38
			
28
		}
39
		}
29
	}
40
	}
30
	
41
	
31
	/**
42
	/**
32
	 * Resets current PythonInterpreter instance
43
	 * Resets current PythonInterpreter instance