From: <mor...@ya...> - 2003-09-21 13:42:33
|
With jythonc (2.1 and 2.2a) one can generate *.jave code by using the "-C NONE" option. There is another jythonc option allows one to specify the package for the generated code. Both options work in isolation, but jythonc gives an error when they used together! So: OK : jythonc -C NONE test\*.py OK : jythonc -p net.mypackage test\*.py !!FAILS!!: jythonc -p net.mypackage -C NONE test\*.py For error details see below (it appears that the error is that one part of jythonc simply forgets that it is not supposed to compile into classes). Besides being wonderful for understanding how jython work, the *.java generation feature is essential for debugging, post-processing,and integration with other non-python aware development tools. Besides, the package option is essential for avoiding collisions with other libraries. I therefore hope that somebody can fix this in 2.2 + let me know how to patch this in the meantime. Cheers, Morten C. ------ ERROR DETAILS BELOW -------: jythonc -p net.mypackage -C NONE test\*.py processing ptest Required packages: Creating adapters: Creating .java files: ptest module Leaving .java files, no compiler specified Traceback (innermost last): File "C:\javalibs\jython-2.1\Tools\jythonc\jythonc.py", line 5, in ? File "C:\javalibs\jython-2.1\Tools\jythonc\main.py", line 301, in main File "C:\javalibs\jython-2.1\Tools\jythonc\main.py", line 262, in writeResults File "C:\javalibs\jython-2.1\Tools\jythonc\main.py", line 236, in copyclass java.io.FileNotFoundException: .\jpywork\net\mypackage\ptest.class (The syste m cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at java.io.FileInputStream.<init>(FileInputStream.java:66) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructo r.java) at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java) at org.python.core.PyJavaClass.__call__(PyJavaClass.java) at org.python.core.PyObject.__call__(PyObject.java) at main$py.copyclass$7(C:\javalibs\jython-2.1\Tools\jythonc\main.py:236) at main$py.call_function(C:\javalibs\jython-2.1\Tools\jythonc\main.py) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyFunction.__call__(PyFunction.java) at main$py.writeResults$8(C:\javalibs\jython-2.1\Tools\jythonc\main.py:2 62) at main$py.call_function(C:\javalibs\jython-2.1\Tools\jythonc\main.py) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyFunction.__call__(PyFunction.java) at main$py.main$9(C:\javalibs\jython-2.1\Tools\jythonc\main.py:301) at main$py.call_function(C:\javalibs\jython-2.1\Tools\jythonc\main.py) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyFunction.__call__(PyFunction.java) at org.python.core.PyObject.invoke(PyObject.java) at org.python.pycode._pyx0.f$0(C:\javalibs\jython-2.1\Tools\jythonc\jyth onc.py:5) at org.python.pycode._pyx0.call_function(C:\javalibs\jython-2.1\Tools\jy thonc\jythonc.py) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.__builtin__.execfile_flags(__builtin__.java) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java) at org.python.util.jython.main(jython.java) java.io.FileNotFoundException: java.io.FileNotFoundException: .\jpywork\mypackage\ptest.class (The system cannot find the file specified) ------------ Yahoo! Mail - Gratis: 6 MB lagerplads, spamfilter og virusscan |