From: Mike H. <th...@bi...> - 2002-11-26 19:57:45
|
On Tue, Nov 26, 2002 at 01:51:01PM -0600, Mike Hostetler wrote: > > I'm trying to take a simple Jython script and put it into a jar file. I > can *do* that, but I don't know how to access my script after that. > > I only have one function in the file: > > def evenJob(jobData): > if not jobData: > return None > elif (jobData.jobId.getID()%2 == 0) : > return 1 > else: > return None > > This function is in a class very wittingly called "evenjob.py". oops. I mean a file called "evenjob.py" > So I use jythonc to put it in a jar file with package name "com.workpoint.qa.python": > jythonc --jar jythonqa.jar -p "com.workpoint.qa.python" evenjob.py > > And I have it in a jar, but I don't know how to access my evenJob > function. Example (from Jython): > > mikeh@tardis embed_jython $ jython > Jython 2.1 on java1.4.1_01 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.path.append("jythonqa.jar") > >>> from com.workpoint.qa.python import evenjob > >>> evenjob.evenJob > Traceback (innermost last): > File "<console>", line 1, in ? > AttributeError: class 'com.workpoint.qa.python.evenjob' has no attribute > 'evenJob' > >>> > > -- > > > ------------------------------------------------------- > This SF.net email is sponsored by: Get the new Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users -- |