From: Brian C. <cor...@gm...> - 2006-02-01 22:23:39
|
Kevin, I recently ran into this. I had to make my Jython class extend/implement a "Real" Java class in order to get jythonc to expose the function as a public method in Java. (I was working with Jython22a1) There may be other/better ways to do this, but this worked for me. Thanks, Brian On 2/1/06, Kevin Whinnery <Kev...@la...> wrote: > > Hello all, > > I am attempting to use the @sig mechanism to make functions I have define= d > in a Python script available to Java: > > <code> > > def createResponseFile(responseFilePath, destinationPath): > "@sig public static void createResponseFile(java.lang.String > responseFilePath, java.lang.String destinationPath)" > # my code follows > # .... > > </code> > > When I run jythonc on this file, this is the Java code that is generated = for > this function in the PyInner class: > > <code> > > private static PyObject createResponseFile$1(PyFrame frame) { > /* @sig public static void createResponseFile(java.lang.Strin= g > responseFilePath, java.lang.String destinationPath) */ > //my code follows > //.... > } > > </code> > > > It seems jythonc just thinks this is a comment in my script, and doesn't > create a public interface to the function I wrote in Python. Am I doing > something wrong? Is there something else I need to do in order to make m= y > Python functions callable from Java? Any help anyone could offer would b= e > greatly appreciated... > > Kevin Whinnery > Associate Software Engineer > E-Mail: Kev...@la... > Phone: (651) 767-6497 > > Lawson Software > 380 St. Peter St. > St. Paul, MN 55102 |