Message2225
The idea of this patch is to allow easy disabling of
the package scanning process in situations where it is
not wanted, such as:
- no write access to the file system
- many concurrent users accessing the same jython
installation
I tried to keep the patch as small as possible (only
changing 2 lines in one file, and a new registry
entry). Because the flag is only needed in one place,
there is no change to Options.java.
The registry contains a new entry as follows:
# Setting this property to false disables the
package scan for the cachedir.
# Please be aware that disabling this might break
some import statements!
python.package.scan = true
Changes to PySystemState.java (method initPackages
(Properties props)):
OLD:
10 private static void initPackages(Properties
props) {
20 initCacheDirectory(props);
30 File pkgdir;
40 if (cachedir != null) {
50 pkgdir = new File(cachedir, "packages");
60 } else {
70 pkgdir = null;
80 }
90 packageManager = new SysPackageManager
(pkgdir, props);
100 }
NEW (add line 35 and modify line 40):
10 private static void initPackages(Properties
props) {
20 initCacheDirectory(props);
30 File pkgdir;
*35 boolean packageScan =
* props.getProperty
("python.package.scan", "true").equalsIgnoreCase
("true");
*40 if (cachedir != null && packageScan) {
50 pkgdir = new File(cachedir, "packages");
60 } else {
70 pkgdir = null;
80 }
90 packageManager = new SysPackageManager
(pkgdir, props);
100 }
|
|
Date |
User |
Action |
Args |
2008-02-20 17:18:17 | admin | link | issue525092 messages |
2008-02-20 17:18:17 | admin | create | |
|