You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John G. <jgo...@co...> - 2001-09-04 16:17:22
|
"Humbel Otmar" <Otm...@bi...> writes: > Just inside the class, but **without** the self parameter. Given file > Foo.py: Hmm, that's fascinating. I'm a bit new to Python as well, so let me follow up with some additional questions. I take it that the static method would have an @sig denoting static? Also, hypothetically, if there were multiple classesin the same file declaring "static" methods, how does python resolve the ambiguity? -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |
From: Vasanthi, N (Nagalingam) <N.V...@dl...> - 2001-09-04 16:08:22
|
Hi, I am testing my java applications using jython. I would like to know how a java method which returns an primitive array be used in jython eg) say my java method is public int[] read() I want to do something like this from jarray import array arr = read() # I am not able to do this print arr thanks vasanthi |
From: Humbel O. <Otm...@bi...> - 2001-09-04 16:01:00
|
[ John Goerzen ] >=20 > Another question (sorry about all of these!) >=20 > I'm porting more Java code to Jython. I've got a case like: >=20 > public static String myfunc(String id) >=20 > I'm unsure how to do a static method in Jython. Do I declare it in my > .py oustide the class: area with a @sig that has static in it? Just inside the class, but **without** the self parameter. Given file Foo.py: class Foo: # constructor def __init__( self ): pass =20 # an instance method def fooMethod( self, argument ): print "called fooMethod(%s)" % argument =20 # a 'static' method def myfunc( id ): print "called myfunc(%s)" % id Then you can call myfunc 'statically': jython -i Foo.py >>> Foo.myfunc( "hello" ) called myfunc(hello) >>> foo =3D Foo() >>> foo.fooMethod( "hi" ) called fooMethod(hi) >>>=20 Hope this helps, Oti. |
From: John G. <jgo...@co...> - 2001-09-04 15:07:38
|
Another question (sorry about all of these!) I'm porting more Java code to Jython. I've got a case like: public static String myfunc(String id) I'm unsure how to do a static method in Jython. Do I declare it in my .py oustide the class: area with a @sig that has static in it? -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |
From: Frank C. <fc...@pu...> - 2001-09-04 14:25:25
|
Thanks for the referral to Bruce Eckel's book but that is a different work from the book on Jython. The book I was lent was in English. -Frank -- Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for Load, a free open-source tool for performance and scalability testing and data migration. > From: "Robert W. Bill" <rb...@di...> > Date: Tue, 4 Sep 2001 02:18:59 -0500 (CDT) > To: Frank Cohen <fc...@pu...> > Cc: <jyt...@li...> > Subject: Re: [Jython-users] Jython Book? > > Hello Frank, > > On Mon, 3 Sep 2001, Frank Cohen wrote: >> A friend lent me his copy of the Jython book. He moved to Chicago last week >> and asked for it back. I figured I could just go onto Amazon or >> ComputerLiteracy and order a copy. No luck. >> >> All I know is this was a big book (300+ pages plus CD) specifically on >> Jython. It may have been by ORielly. Does anyone know the title of this >> book, or where I could get a copy? >> >> -Frank > > Was the book in english? I'm unaware of any available jython-specific > publication. The library of congress only lists one book with "Jython" in > the title, and it's not out until December. > > What it could have been is Bruce Eckel's "Thinking In Patterns with Java", > which has a nice Jython chapter (9). > > > -robert > |
From: John G. <jgo...@co...> - 2001-09-04 13:08:32
|
"Robert W. Bill" <rb...@di...> writes: >> >> There seems to be no way to specify two @sig lines. > > True, but jythonc doesn't require multiple sigs. > OK, your example worked for that problem (thanks!) However now I've got another one. I have a case in Java where a constructor can take either a BigDecimal, an int, or a String as an argument. I need to clone this constructor in Python. In this case, it seems I do need multiple @sigs, right? I suppose if it weren't for the int option, I could just say java.lang.Object, but that's kinda ugly anyway. -- John -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |
From: Robert W. B. <rb...@di...> - 2001-09-04 07:19:51
|
Hello Frank, On Mon, 3 Sep 2001, Frank Cohen wrote: > A friend lent me his copy of the Jython book. He moved to Chicago last week > and asked for it back. I figured I could just go onto Amazon or > ComputerLiteracy and order a copy. No luck. > > All I know is this was a big book (300+ pages plus CD) specifically on > Jython. It may have been by ORielly. Does anyone know the title of this > book, or where I could get a copy? > > -Frank Was the book in english? I'm unaware of any available jython-specific publication. The library of congress only lists one book with "Jython" in the title, and it's not out until December. What it could have been is Bruce Eckel's "Thinking In Patterns with Java", which has a nice Jython chapter (9). -robert |
From: Humbel O. <Otm...@bi...> - 2001-09-04 07:18:34
|
Hello, I am still struggling to port our application from JPython 1.0.3 to Jython 2.x. ... So please forgive me for asking:=20 Where has the Perl5StreamInput gone ? I could not find a hint on the apache website. Or, how could it be replaced, since our application is using the 'old': import com.oroinc.text.regex.Perl5StreamInput; Many thanks, and best wishes. Oti. |
From: Frank C. <fc...@pu...> - 2001-09-04 05:55:19
|
A friend lent me his copy of the Jython book. He moved to Chicago last week and asked for it back. I figured I could just go onto Amazon or ComputerLiteracy and order a copy. No luck. All I know is this was a big book (300+ pages plus CD) specifically on Jython. It may have been by ORielly. Does anyone know the title of this book, or where I could get a copy? -Frank -- Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for Load, a free open-source tool for performance and scalability testing and data migration. |
From: Ype K. <yk...@xs...> - 2001-09-03 18:25:46
|
Silvio, >Hello everybody, >I'm preparing a presentation to show the work I did in Jython and CPython to the rest of my team (most of them don't know anything about Python), and explain them what we can do with this powerful "new stuff". >Among the other things, I should explain why in Jython we can import directly the Java packages while in CPython we have to deal with creating extension modules. >I am going to simplify things like this (please someone tell me if I'm wrong!): >Jython translates Python objects, exceptions and threads to real Java ones. So the logic for the run-time handling of objects (including memory allocation, for example), exceptions and threads is all in the JVM, the Jython interpreter behaves more or less like an interface. Correct, but it doesn't seem right to confuse an interpreter and an interface. You might say that the interpreter is implemented in the JVM, ie. it is "just another" java program. > This allows the seamless integration, since other programs of the Java platform are running over the same JVM. Yes. >CPython interpreter is coded in C, and relies directly on the OS. The logic for run-time handling of objects and exceptions, and for handling threads over the OS ones (that are more "stupid" than Python or Java ones) is coded inside the interpreter. However, Jython threads are much closer to Java threads and CPython threads are to C threads. (Python's thread model was designed to be similar to java's thread model.) > That's why extensions are needed, to make the C code deal with Python objects, exceptions and threads (exceptions and new object definitions are actually handled in a Python wrapper module, and not directly in the C extension, but anyway that's a logical part of the extension as well). I'd put it the other way around: from within jython you can call java code directly because of the introspection abilities of the java language. This introspection allows the mapping of Jython types to/from java types that is built into jython. When you want to call jython code from java code you still need to conform to jython implementation conventions (ie. import things from the org.python.core package). C does not have such detailed introspection, so C code that is available to the CPython interpreter must conform to the more rigid interface definitions of Python C extension modules, ie. C header files, to be called correctly. >Is it correct? Yes. >Did I catch the real reasons? Yes, but not all of them. Probably there are even more. Could someone else give a comparison between using org.python.core from java and using the Python wrapper module from C python extensions? I have no experience in the latter. >thanks for your help, >Silvio. My pleasure, Ype > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Silvio A. <sar...@mo...> - 2001-09-03 13:31:08
|
Hello everybody, I'm preparing a presentation to show the work I did in Jython and CPython to the rest of my team (most of them don't know anything about Python), and explain them what we can do with this powerful "new stuff". Among the other things, I should explain why in Jython we can import directly the Java packages while in CPython we have to deal with creating extension modules. I am going to simplify things like this (please someone tell me if I'm wrong!): Jython translates Python objects, exceptions and threads to real Java ones. So the logic for the run-time handling of objects (including memory allocation, for example), exceptions and threads is all in the JVM, the Jython interpreter behaves more or less like an interface. This allows the seamless integration, since other programs of the Java platform are running over the same JVM. CPython interpreter is coded in C, and relies directly on the OS. The logic for run-time handling of objects and exceptions, and for handling threads over the OS ones (that are more "stupid" than Python or Java ones) is coded inside the interpreter. That's why extensions are needed, to make the C code deal with Python objects, exceptions and threads (exceptions and new object definitions are actually handled in a Python wrapper module, and not directly in the C extension, but anyway that's a logical part of the extension as well). Is it correct? Did I catch the real reasons? thanks for your help, Silvio. |
From: Ted B. <te...@et...> - 2001-09-02 11:15:27
|
On Sunday 02 September 2001 03:49, Ype Kingma wrote: > > First off: I am not familiar with JDOM and XML, so what follows > might be quite non relevant. Not a problem. Actually, I think the issue is more likely a python-related mistake that I'm making. > It seems to me that your problem might be caused by > > f = InstallSetTreeModel( self ) > > returning self instead of a newly created InstallSetTreeModel. > Supposing this is a constructor call, why is self passed? > In case you want a new child node (f is appended to self.children > lateron), you might introduce a separate method for creating > a new child node. > The argument is used to create a reference-to-parent in the new object, like so: def __init__( self, parent=None ): self.parent = parent which is used to determine the topmost object in the tree. ted |
From: Ype K. <yk...@xs...> - 2001-09-02 09:43:06
|
Ted, >I'm trying to build a simple XML editor targetted at a specific use. I am >displaying the xml node names as elements in a JTree and have implemented a >TreeModel to accomplish this. > >The nodes in the tree model extract relevant info from a JDOM Element object >passed to their fromXML method after creation. This method populates the >callee node's child list and calls each child's fromXML method. > >From the print out generated by the fromXML method, it appears that >everything is working, but when the process is complete another print shows >that something has gone dramatically wrong. > >print generated during population: > > [Element: <nodehandler/>] > [Element: <group_atts/>] > [Element: <nodehandler/>] > [Element: <file/>] > [Element: <nodehandler/>] > [Element: <file/>] > [Element: <nodehandler/>] > [Element: <file/>] > >print of tree root element's 'children' list after population of the >TreeModel: > >[group_atts, file, nodehandler, file, nodehandler, file, nodehandler] > >Relevant code snippet from InstallSetTreeModel: > > def fromXML( self, node, space='' ): > print space,node > self.name = node.name > for n in node.children: > f = InstallSetTreeModel( self ) > f.fromXML( n, space+' ') > self.children.append( f ) > >Obviously *something* isn't right. What am I doing wrong? node is a JDOM >Element object, node.children returns a List of child Elements. Once this >model is placed in a tree, each node in the tree has for children each node in the tree. It's a *huge* circular reference bug, and I haven't been able >to find it. First off: I am not familiar with JDOM and XML, so what follows might be quite non relevant. It seems to me that your problem might be caused by f = InstallSetTreeModel( self ) returning self instead of a newly created InstallSetTreeModel. Supposing this is a constructor call, why is self passed? In case you want a new child node (f is appended to self.children lateron), you might introduce a separate method for creating a new child node. > >The code is part of a project that will allow java/jython applications to >download updates from a website. The whole shebang will be publicly >available when i'm done too, if that's any sort of carrot. :) > >I can post the whole file if it would help, I just wanted to avoid spamming >the list right off. > >ted > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Ted B. <te...@et...> - 2001-09-02 03:25:09
|
I'm trying to build a simple XML editor targetted at a specific use. I am displaying the xml node names as elements in a JTree and have implemented a TreeModel to accomplish this. The nodes in the tree model extract relevant info from a JDOM Element object passed to their fromXML method after creation. This method populates the callee node's child list and calls each child's fromXML method. From the print out generated by the fromXML method, it appears that everything is working, but when the process is complete another print shows that something has gone dramatically wrong. print generated during population: [Element: <nodehandler/>] [Element: <group_atts/>] [Element: <nodehandler/>] [Element: <file/>] [Element: <nodehandler/>] [Element: <file/>] [Element: <nodehandler/>] [Element: <file/>] print of tree root element's 'children' list after population of the TreeModel: [group_atts, file, nodehandler, file, nodehandler, file, nodehandler] Relevant code snippet from InstallSetTreeModel: def fromXML( self, node, space='' ): print space,node self.name = node.name for n in node.children: f = InstallSetTreeModel( self ) f.fromXML( n, space+' ') self.children.append( f ) Obviously *something* isn't right. What am I doing wrong? node is a JDOM Element object, node.children returns a List of child Elements. Once this model is placed in a tree, each node in the tree has for children each node in the tree. It's a *huge* circular reference bug, and I haven't been able to find it. The code is part of a project that will allow java/jython applications to download updates from a website. The whole shebang will be publicly available when i'm done too, if that's any sort of carrot. :) I can post the whole file if it would help, I just wanted to avoid spamming the list right off. ted |
From: dman <ds...@ri...> - 2001-09-01 22:05:18
|
On Sat, Sep 01, 2001 at 06:50:51AM -0400, Mats Wichmann wrote: | | >GUESS #2: | >Maybe the browser isn't actually using the Java plugin. Because | >browsers don't come with out-of-the-box support for the JDK 1.3.1 | >you are using, you must make sure the plug-in is really installed | >and being used. Without the plug-in, use JDK1.1.8 to compile | >Jython applets. | | To jump in with a question, I've had lots of trouble with the | Java plugin (like, I've never actually made an applet work; | the plugin itself appears to come alive as the little icon | appears in my tool tray on Win2k). Does anyone have a recipe | for making it work? Are you using netscape? If so then you can display the "java console" which is a window showing stdout and stderr. You are probably having classpath problems. -D |
From: Mats W. <ma...@la...> - 2001-09-01 20:47:19
|
>GUESS #2: >Maybe the browser isn't actually using the Java plugin. Because >browsers don't come with out-of-the-box support for the JDK 1.3.1 >you are using, you must make sure the plug-in is really installed >and being used. Without the plug-in, use JDK1.1.8 to compile >Jython applets. To jump in with a question, I've had lots of trouble with the Java plugin (like, I've never actually made an applet work; the plugin itself appears to come alive as the little icon appears in my tool tray on Win2k). Does anyone have a recipe for making it work? |
From: Scott H. <sl...@ho...> - 2001-09-01 14:59:27
|
After much help from Robet Bill, I have my applet issues down to a = single problem. If I take out the urllib.urlretrieve calls, the applet = works ok. If I leave them in, it dies with a message about not being = able to find the codec (the exact message is below): Lookup Error: no codec search functions registered: can't find = encoding Does anyone know what this means and how to get around it? Thanks, Scott |
From: John G. <jgo...@co...> - 2001-09-01 05:14:17
|
Jas...@Le... writes: > try: > > from myapp.util import UtilClass Ahh... from reading the docs, I had thought that I had to add 'java.' before any Java stuff. I guess just all the examples used that :-) OK, I'll try that. Thanks! |
From: Robert W. B. <rb...@di...> - 2001-09-01 00:46:26
|
Hi John, On Fri, 31 Aug 2001, John Goerzen wrote: > Hi, > > I'm trying out Jython for the first time but the documentation have > not covered this scenario: > > I want to make a class that is callable by Java, that is a child only > of java.lang.Object, whose constructor can take 0 or 1 arguments. > > There seems to be no way to specify two @sig lines. True, but jythonc doesn't require multiple sigs. > import java > > class Foo(java.lang.Object): > def __init__(self, arg=None): > """@sig public Foo() > @sig public Foo(String arg)""" > if arg: > print arg > else: > print "No arg passed" You don't need multiple @sigs, jythonc figures it out for you. In your code example, the only @sig you need is "@sig public Foo(String arg)". If you take a peek at Foo.java, you will see that you also get an empty constructor for free. Additionally, if you have two default args, jythonc adds constructors for no args, 1 arg, and 2 args. for example: import java class Foo(java.lang.Object): def __init__(self, arg1=None, arg2=None): "@sig public Foo(String arg1, String arg2)" print arg1, arg2 With that one @sig string, you can call the constructors from Java: test t = new test(); test t = new test("bar"); test t = new test("bar", "zab"); -rb |
From: Robert W. B. <rb...@di...> - 2001-08-31 23:06:22
|
On Fri, 31 Aug 2001, Scott Hathaway wrote: > Robert, > > Thanks for the reply. Only the .jar file is a different name. I have tried > renaming the .jar to the name of the class too, without success. I get the > exact same error. > > Any other ideas? If you are sure that the class name and the name of the file that contains it matches (e.g. "dlClient.py" contains "class dlClient"), then I'm short on ideas. But I get 3 guesses don't I? GUESS #2: Maybe the browser isn't actually using the Java plugin. Because browsers don't come with out-of-the-box support for the JDK 1.3.1 you are using, you must make sure the plug-in is really installed and being used. Without the plug-in, use JDK1.1.8 to compile Jython applets. I hope this works. I don't really have a third guess <G> -robert > ----- Original Message ----- > From: "Robert W. Bill" <rb...@di...> > To: "Scott Hathaway" <sl...@ho...> > Cc: <jyt...@li...> > Sent: Friday, August 31, 2001 4:49 PM > Subject: Re: [Jython-users] help with jython and creating an applet > > > > Hello Scott, > > > > Your file is "dlClient.py" and your class is "downloadClient." Try it > > with matching filename and classname instead. A jythonc-compiled module > > must meet special restrictions to play nice in a Java > > framework, even though these restrictions don't apply to Jython- as > > you have already seen. Matching filename-classname is one of them. > > > > > > On Fri, 31 Aug 2001, Scott Hathaway wrote: > > > I am trying to create a jython applet. I am running Windows 2000 pro > > > with Sun's JDK 1.3.1 and I have tried both Jython 2.0 and 2.1a3. My > > > code runs fine when I execute it with Jython, but when comiling it into > > > the applet with (I have only one .py file named dlClient.py): > > > > > > jython --compiler javac --all --jar downloadClient.jar *.py > > > > > > The .jar is created, but it gives a warning about using a deprecated > API. Then when I try to execute it with the appletviewer, I get an error > that says: > > > > > > java.lang.ClassCastException: dlClient > > > > > > Can anyone tell me what I am doing wrong? Below, I have posted the code > for the .py file as well. > > > > > > from java import applet > > > from java.awt import Color,Label,Button,GridLayout,Label > > > from urllib import urlretrieve > > > import time > > > > > > class downloadClient(applet.Applet): > > > def init(self): > > > try: > > > self.setLayout(GridLayout(0,1)) > > > self.title = self.add(Label('Download Test', Label.CENTER)) > > > self.title.setBackground(Color.blue) > > > self.title.setForeground(Color.white) > > > self.add(Label('Beginning Download ...')) > > > # this file is 45.7k in size > > > self.startTime = time.time() > > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > > self.endTime = time.time() > > > self.elapsedTime = int(self.endTime - self.startTime) > > > self.kPerSec = int(137.1/self.elapsedTime) > > > self.add(Label('Download Complete')) > > > self.add(Label('Amount Downloaded: 137.1 KB')) > > > self.add(Label('Time Elapsed: ' + str(self.elapsedTime) + ' > seconds')) > > > self.totalSpeed = self.add(Label('Total Speed: ' + str(self.kPerSec) > + ' KB/Sec')) > > > self.totalSpeed.setBackground(Color.yellow) > > > #self.totalSpeed.setForeground(Color.blue) > > > except: > > > pass > > > > > > if __name__ == '__main__': > > > import pawt > > > pawt.test(downloadClient()) > > > > > > > > |
From: Scott H. <sl...@ho...> - 2001-08-31 22:35:26
|
Robert, Thanks for the reply. Only the .jar file is a different name. I have tried renaming the .jar to the name of the class too, without success. I get the exact same error. Any other ideas? Thanks, Scott ----- Original Message ----- From: "Robert W. Bill" <rb...@di...> To: "Scott Hathaway" <sl...@ho...> Cc: <jyt...@li...> Sent: Friday, August 31, 2001 4:49 PM Subject: Re: [Jython-users] help with jython and creating an applet > Hello Scott, > > Your file is "dlClient.py" and your class is "downloadClient." Try it > with matching filename and classname instead. A jythonc-compiled module > must meet special restrictions to play nice in a Java > framework, even though these restrictions don't apply to Jython- as > you have already seen. Matching filename-classname is one of them. > > > On Fri, 31 Aug 2001, Scott Hathaway wrote: > > I am trying to create a jython applet. I am running Windows 2000 pro > > with Sun's JDK 1.3.1 and I have tried both Jython 2.0 and 2.1a3. My > > code runs fine when I execute it with Jython, but when comiling it into > > the applet with (I have only one .py file named dlClient.py): > > > > jython --compiler javac --all --jar downloadClient.jar *.py > > > > The .jar is created, but it gives a warning about using a deprecated API. Then when I try to execute it with the appletviewer, I get an error that says: > > > > java.lang.ClassCastException: dlClient > > > > Can anyone tell me what I am doing wrong? Below, I have posted the code for the .py file as well. > > > > from java import applet > > from java.awt import Color,Label,Button,GridLayout,Label > > from urllib import urlretrieve > > import time > > > > class downloadClient(applet.Applet): > > def init(self): > > try: > > self.setLayout(GridLayout(0,1)) > > self.title = self.add(Label('Download Test', Label.CENTER)) > > self.title.setBackground(Color.blue) > > self.title.setForeground(Color.white) > > self.add(Label('Beginning Download ...')) > > # this file is 45.7k in size > > self.startTime = time.time() > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > rValue = urlretrieve("http://localhost/reports/detail.pdf") > > self.endTime = time.time() > > self.elapsedTime = int(self.endTime - self.startTime) > > self.kPerSec = int(137.1/self.elapsedTime) > > self.add(Label('Download Complete')) > > self.add(Label('Amount Downloaded: 137.1 KB')) > > self.add(Label('Time Elapsed: ' + str(self.elapsedTime) + ' seconds')) > > self.totalSpeed = self.add(Label('Total Speed: ' + str(self.kPerSec) + ' KB/Sec')) > > self.totalSpeed.setBackground(Color.yellow) > > #self.totalSpeed.setForeground(Color.blue) > > except: > > pass > > > > if __name__ == '__main__': > > import pawt > > pawt.test(downloadClient()) > > > > |
From: <Jas...@Le...> - 2001-08-31 22:30:44
|
try: from myapp.util import UtilClass cheers, jason songhurst -----Original Message----- From: John Goerzen [mailto:jgo...@co...] Sent: Friday, August 31, 2001 3:54 PM To: jyt...@li... Subject: [Jython-users] import problems Hi, In my .py file (again compiled with jythonc to be called from java), I have something like this: import java from java.myapp.util import UtilClass I get a runtime error complaining that the "myapp" module does not exist. What is the proper way of doing this? (Note that all sorts of other things find myapp.util.UtilClass without problems.) -- John _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |
From: Robert W. B. <rb...@di...> - 2001-08-31 22:25:06
|
Hi John, On Fri, 31 Aug 2001, John Goerzen wrote: > Hi, > > In my .py file (again compiled with jythonc to be called from java), I > have something like this: > > import java > from java.myapp.util import UtilClass > > I get a runtime error complaining that the "myapp" module does not > exist. What is the proper way of doing this? (Note that all sorts of > other things find myapp.util.UtilClass without problems.) The difference between your import line and your last sentence confused me a bit. Excuse the confusion, but Is the package declared as "myapp.util.UtilClass" or "java.myapp.util.UtilClass"? If the actual package name is myapp.util.UtilClass, then the import should be changed to: from myapp.util import UtilClass If I'm just confused about the package name, and the import really right, then try giving a Java package hint to the SystemState with sys.add_package(packagename): import java, sys sys.add_package(java.myapp.util) from java.myapp.util import UtilClass -robert |
From: John G. <jgo...@co...> - 2001-08-31 21:53:38
|
Hi, In my .py file (again compiled with jythonc to be called from java), I have something like this: import java from java.myapp.util import UtilClass I get a runtime error complaining that the "myapp" module does not exist. What is the proper way of doing this? (Note that all sorts of other things find myapp.util.UtilClass without problems.) -- John |
From: Robert W. B. <rb...@di...> - 2001-08-31 21:50:17
|
Hello Scott, Your file is "dlClient.py" and your class is "downloadClient." Try it with matching filename and classname instead. A jythonc-compiled module must meet special restrictions to play nice in a Java framework, even though these restrictions don't apply to Jython- as you have already seen. Matching filename-classname is one of them. On Fri, 31 Aug 2001, Scott Hathaway wrote: > I am trying to create a jython applet. I am running Windows 2000 pro > with Sun's JDK 1.3.1 and I have tried both Jython 2.0 and 2.1a3. My > code runs fine when I execute it with Jython, but when comiling it into > the applet with (I have only one .py file named dlClient.py): > > jython --compiler javac --all --jar downloadClient.jar *.py > > The .jar is created, but it gives a warning about using a deprecated API. Then when I try to execute it with the appletviewer, I get an error that says: > > java.lang.ClassCastException: dlClient > > Can anyone tell me what I am doing wrong? Below, I have posted the code for the .py file as well. > > from java import applet > from java.awt import Color,Label,Button,GridLayout,Label > from urllib import urlretrieve > import time > > class downloadClient(applet.Applet): > def init(self): > try: > self.setLayout(GridLayout(0,1)) > self.title = self.add(Label('Download Test', Label.CENTER)) > self.title.setBackground(Color.blue) > self.title.setForeground(Color.white) > self.add(Label('Beginning Download ...')) > # this file is 45.7k in size > self.startTime = time.time() > rValue = urlretrieve("http://localhost/reports/detail.pdf") > rValue = urlretrieve("http://localhost/reports/detail.pdf") > rValue = urlretrieve("http://localhost/reports/detail.pdf") > self.endTime = time.time() > self.elapsedTime = int(self.endTime - self.startTime) > self.kPerSec = int(137.1/self.elapsedTime) > self.add(Label('Download Complete')) > self.add(Label('Amount Downloaded: 137.1 KB')) > self.add(Label('Time Elapsed: ' + str(self.elapsedTime) + ' seconds')) > self.totalSpeed = self.add(Label('Total Speed: ' + str(self.kPerSec) + ' KB/Sec')) > self.totalSpeed.setBackground(Color.yellow) > #self.totalSpeed.setForeground(Color.blue) > except: > pass > > if __name__ == '__main__': > import pawt > pawt.test(downloadClient()) > |