|
From: <bc...@wo...> - 2001-01-08 15:24:42
|
On Mon, 8 Jan 2001 14:06:02 +0100, you wrote: >Hello, >I have a small question. >A standard Jython installation uses some information from the Jython >registry-file. >If I embedd the Jython interpreter in a application, the registry file will >might not be accessible any more. Instead you can manually initialize the jython runtime by calling PySystemState.initialize(preProperties, postProperties, argv): - preProperties is useally System.getProperties(). - postProperties can be a java.util.Properties with your own property values. - argv will be copied to sys.argv >So is the registryfile executed as a python script, >or is it read in as a java.util.Properties table? Both registry files (<python.home>/registry & <user.home>/.jython) are java.util.Properties files. >Can I place Jython command in there? No. >Can I reread the registry file? No. You can't meaningfully modify the sys.registry object either. After the property files are read (and merged with Properties arguments to PySystemState.initialize()) the static fields in org.python.core.Options is initialized. The rest of the jython runtime are looking at these fields when it needs some configuration information. >if yes How can I do that? > >Assume I have multiple interpreter embedded in one JVM. Do they all share >the same registry information? They all share the static values of the org.python.core.Options fields. regards. finn |