|
From: Samuele P. <pe...@in...> - 2001-08-22 21:15:27
|
Hi. I'm a bit unhappy with the actual form of the proposal. It seems more a mixture/mismatch beetween things that are good for jython -jar and some that are good for java -jar ... > The JYTHON-PACKAGE-* entries will be used by the package-manager's > packageExists() That's neat. > > The RunJar startup utility shows how /applications/ can be deployed > using the "java -jar" syntax. An index is generated of all the java > packages in the java system and stored in the main jar file together > with manifest file like this: > > Name: python.main > Main-Script: mytest.py > > Name: python.options > python-security-respectJavaAccessibility: true > python-skipcachedir: true > python-prepath: > python-path: mytest.jar > > (notice that the jar file that includes the $py.class files must be > available on sys.path. That's the critical part. It seems that the CWD should be the directory with the jar otherwise java -jar will fail ... or I'm mislooking something. > We can't load python modules from resources yet I don't even know if that would be a good idea, maybe we should just load them through the Java system classloader as happen with jythonc-ed code. > > Problems: > > - Because the JYTHON-PACKAGE-* files is found as resources, only one > version of a package index can be loaded. If the classes in a > javapackage is split over more than one jar file, only the class files > in the first jar will be loaded with "import *" and show up in > dir(javapackage). That's not a big problem, if you're using java -jar there is just one jar up to java extensions... or are you referring to jars on sys.path? but then getClass() in the patch is suboptimal. > - The tool only scan jar and zip files when making the index. It does > not scan directories on the class path. This make sense. > > - Python module can not be loaded as resources, so none of this helps > with the applet situation. But IMHO the solution for applets should be the same for java -jar vs. the solution for jython -jar ... regards. |