From: Kevin M. <kev...@er...> - 2001-09-20 13:15:29
|
On Thu, 20 Sep 2001, Humbel Otmar wrote: > maybe this could be a typo. You had in test2.py: > sys.add_package("com.ericcson.test1") Doh! I am going blind with the permutations. Now I get a _little_ further. test1.py: --------- class gofaster: def __init__(self): print "Zoom" gofaster() Compile: -------- # jythonc -a -p com.ericsson.test1 -j test1.jar test1.py test2.py: --------- import sys sys.add_package("com.ericsson.test1") import com.ericsson.test1 print "dir(com.ericsson.test1):", dir(com.ericsson.test1) com.ericsson.test1.test1.main([""]) Compile: -------- # jythonc -a -p com.ericsson.test2 -j test2.jar test2.py Test: ----- # java -jar test2.jar dir(com.ericsson.test1): ['__name__'] Java Traceback: at org.python.core.Py.AttributeError(Py.java:90) at org.python.core.PyObject.__getattr__(PyObject.java:672) at com.ericsson.test2.test2$_PyInner.main$1(test2.java:47) at com.ericsson.test2.test2$_PyInner.call_function(test2.java:34) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.imp.createFromCode(imp.java:157) at org.python.core.Py.runMain(Py.java:798) at com.ericsson.test2.test2.main(test2.java:61) Traceback (innermost last): File "/home/qkename/jwork/extdirstest/test2.py", line 0, in main AttributeError: java package 'com.ericsson.test1' has no attribute 'test1' Result: ------- I have stopped adding the Class-Path field to the manifest, since Samuel said that it ignores this and I can confirm it is so. I wonder if calling the add_package procedure is simply allowing the import statement to succeed without providing any real connection to another jar file. test1.jar might as well not exist. Relentlessly, Kevin _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 |