Update of /cvsroot/jython/jython/org/python/core
In directory slayer.i.sourceforge.net:/tmp/cvs-serv14944
Modified Files:
PySystemState.java
Log Message:
initPath(): Append the python.path after the <prefix>/Lib instead of
before. Thjis matches the behavior of site.py and are much more
usefull when adding the CPython libraries.
Also introduce a new python.prepath that get inserted before <prefix>/Lib.
This python.prepath is only intended for very specialized use.
Index: PySystemState.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -r2.36 -r2.37
*** PySystemState.java 2000/12/15 03:19:00 2.36
--- PySystemState.java 2000/12/15 22:13:36 2.37
***************
*** 449,465 ****
PyList path = new PyList();
if (!Py.frozen) {
! String pypath = props.getProperty("python.path", "");
! StringTokenizer tok =
! new StringTokenizer(pypath, java.io.File.pathSeparator);
! while (tok.hasMoreTokens()) {
! String p = tok.nextToken();
! path.append(new PyString(p.trim()));
! }
if (prefix != null) {
String libpath = new File(prefix, "Lib").toString();
path.append(new PyString(libpath));
}
}
return path;
}
--- 449,470 ----
PyList path = new PyList();
if (!Py.frozen) {
! addPaths(path, props.getProperty("python.prepath", "."));
!
if (prefix != null) {
String libpath = new File(prefix, "Lib").toString();
path.append(new PyString(libpath));
}
+
+ addPaths(path, props.getProperty("python.path", ""));
}
return path;
+ }
+
+
+ private static void addPaths(PyList path, String pypath) {
+ StringTokenizer tok = new StringTokenizer(pypath,
+ java.io.File.pathSeparator);
+ while (tok.hasMoreTokens())
+ path.append(new PyString(tok.nextToken().trim()));
}
|