From: Ype K. <yk...@xs...> - 2002-03-13 19:00:45
|
Josh, >Hello all, > I'm working to embed jython within an in-house distributed java >application. I'm really looking to solve two major problems and haven't >come to any answers from looking over the javadoc or the source code. > >- I need a hook into the import functionality of the interpreter. We store >scripts in JAR files that are 'hot-pluggable' into a running system, so when >interpreting a python script that imports another module, I would like to be >able to handle such an event so that I may look through these >'hot-pluggable' JAR files instead of relying on the sys.path or PYTHONPATH >variables. Have a look at imp.java in the org/python/core directory. At the end is the java class you need to replace/enhance. It's possible to do that from both jython code and java code by hooking the built in. Iirc there is work going on on importing from jars. You might ask on jython-dev. <rest already answered> Have fun, Ype -- |