Message101
I append a simple example analogous to the one in demo/javaclasses.
jpythonc should generate methods in the "Simple" proxy class,
based on the signatures in the "@sig ..." docstrings in Simple.py.
Unfortunately, this does not happen when class Simple does not inherit
from anybody. As soon as I add the inheritance relationship to awt,
(outcommented parts, modelled after Graph.py) everything works fine.
Best regards -te
---- Simple.py ---
# from java import awt
# class Simple(awt.Canvas):
class Simple:
def __init__(self, x="Hi, I.m the default initvalue"):
"@sig public Simple(java.lang.String x)"
self.val=x
def output(self):
"@sig public void output()"
print self.val
if __name__=="__main__":
s=Simple("Hello, World")
s.output()
The problem is already apparent after invoking jpythonc - in the generated
Simple.java
file, the constructors and the output method are missing. I append my java
"client"
class only FYI:
--- usesimple.java: ---
import org.python.core.*;
class usesimple {
public static void main(String[] args) {
Simple s;
s=new Simple("Hello from Java");
s.output();
}
}
|
|
| Date |
User |
Action |
Args |
| 2008-02-20 17:16:40 | admin | link | issue222828 messages |
| 2008-02-20 17:16:40 | admin | create | |
|