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: <bc...@wo...> - 2001-07-20 16:02:15
|
[Joern Eckhoff] >While working in a DOS-Box import works really fine. But writing a script >which imports the same pakages throws an exception. It sounds like a embedding problem. Try to check the value of sys.path at the beginning of your script. If you are doing the embedding take a look at this FAQ answer for how to set up a usefull python.path. http://www.jython.org/cgi-bin/faqw.py?req=show&file=faq06.002.htp Otherwise you can always add entries to sys.path from within your script. regards, finn |
From: Jim A. <ji...@tr...> - 2001-07-20 15:48:30
|
Joern Eckhoff wrote: > > ... > Or any hint how to convert an INT to a > STRING without using this intricately solution? Why can't you just use the back-quotes?: >>> a=123 >>> print 'test' + `a` test123 >>> (the BACK-Quotes are below the tilde '~' on my keyboard). -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' "There are many ways of moving forward, but only one way of standing still." - Franklin D. Roosevelt |
From: D-Man <ds...@ri...> - 2001-07-20 15:43:54
|
On Fri, Jul 20, 2001 at 08:02:12AM +0000, Paul Giotta wrote: | | I am currently have a side project that will do something like this. It | is a module that implements a telnet daemon that runs as a java thread. | When someone connects, it starts a jython interpreter and uses this as | the shell for user interaction. Thus, if this is embedded in a running | server, you can connect using an ordinary telnet client and manipulate | object running in the same VM. This is still work in progress, but some | of the sticky points so far: | | - Implementing telnet: I tried to find a java telnet daemon that I | could adapt or borrow code from. There does not seem to be any yet. Also | getting complete and understandable documentation for the telnet protocol | is not that easy (every time I use a new telnet client, it starts trying | to negotiate some other connection parameter that i cannot find in any | documentation). You should probably just ignore anything not mentioned in the RFC. All you need is character input, output, and (ideally) backspace. This is all the interactive interpreter provides anyways (no readline in Java :-( ). If you don't do anything then the telnet client should behave properly (I think). What I mean is, for example, try "telnet mail 25" and see how telnet can connection to an SMTP server just fine. You could also try that on port 80 and see how HTTP daemons have no trouble with it either. A telnet client should be able to connect to any port and behave, though it might not have any advanced terminal features. -D |
From: John D. H. <jh...@is...> - 2001-07-20 14:30:07
|
Hi all, This is really old JPython code that I started when I was doing a lot of = Java=20 coding (~2 years ago). But it might be useful to people. Attached is a JPython module that is supposed to wrap the JDI debugger=20 libraries. I used to run it interactively in JPython and interatively de= bug=20 Java programs. Note: I apparently am missing a Helper module that used to go along with= =20 this, but I don't think it was terribly important. It does mean that thi= s=20 code won't run currently at all though. I hope this is useful to someone. John On Friday 20 July 2001 03:02, Paul Giotta wrote: > I am currently have a side project that will do something like this. It > is a module that implements a telnet daemon that runs as a java thread. > When someone connects, it starts a jython interpreter and uses this as > the shell for user interaction. Thus, if this is embedded in a running > server, you can connect using an ordinary telnet client and manipulate > object running in the same VM. This is still work in progress, but some > of the sticky points so far: > > - Implementing telnet: I tried to find a java telnet daemon that I > could adapt or borrow code from. There does not seem to be any yet. Als= o > getting complete and understandable documentation for the telnet protoc= ol > is not that easy (every time I use a new telnet client, it starts tryin= g > to negotiate some other connection parameter that i cannot find in any > documentation). > > - There has to be a way to get references to the other objects that > you want to manipulate. This can be as simple as placing references to > all of the objects that you want to manipulate into a hashtable that is > statically initialized or available through a singleton. It just need t= o > be done in advance, otherwise the jython interpreter winds up more or > less isolated from the rest of the application. > > - If I try to run multiple instances of jython interpreters in > different threads, bad things start to happen. It is not really critica= l > that I handle multiple connections simultaneously, but I would not expe= ct > this to be a problem. :-( > > > AFAIK it is also possible to remotely connect to a running VM using the > Java debugging API (if the VM was started with debugging options on), s= o > if you go this route, you do not need to provide your own interpreter i= n > that VM, but jython might be helpful in making a simple client. > > The idea of the project above is to do more high level interaction, lik= e > reconfiguration, at runtime. > > -Paul > > > I am experimenting with Jython at the moment. I am impressed. > > > > I was wondering if any jython-guru's have used it to debug Java code. > > > > I guess you could run the Jython interpretor in a seperate thread to = the > > program you're trying to debug. You could then stop the thread from > > jython > > > and inspect the state of its attributes and test calling some of the > > methods. > > > > This would be very handy for experimenting with swing gui's. > > > > Has anybody experimented with some of the Java debugger api's? It may > > even > > > be possible to set break points on particular methods. > > > > Any Ideas would be appreciated. > > > > Thanks, > > Greg. > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users --=20 =2E . . . . . . . . . . . . . . . . . . . . . . . John D. Heintz | Senior Engineer 1016 La Posada Dr. | Suite 240 | Austin TX 78752 T 512.633.1198 | jh...@is... w w w . d a t a c h a n n e l . c o m |
From: Joern E. <Joe...@mi...> - 2001-07-20 13:26:02
|
Hiho @ all, While working in a DOS-Box import works really fine. But writing a script which imports the same pakages throws an exception. Here the procedure (We're now inside the DOS-Box): c:\>jython Jython 2.0 on java1.3.0 (JIT:null) Type "copyright", "credits" or "license" for more information. >>> import fpformat >>> print fpformat.fix(2.1, 0) 2 >>> [CTRL+C] c:\> I'm working with AdventNets' SimulationToolkit which simulates Agents' behavior using jython-scripts. I need to convert an INT to a STRING but found no hint to solve this problem. Therefore I'm using fpformat.fix() because it returnes a string. But the following script always throws an exception: # ---------------------------------- start of jython script ---------------- # Import support for floating point import fpformat # Get the value of the scalar node (provided by the SimulationToolkit) value = scriptinterface.getNodeValue(".1.3.6...") # Convert the value to INT valueAsInt=string.atoi(value) # Add 1.1 to value valueAsFloat=valueAsInt+1.1 # Cut all numbers after dot and dot itself und convert to string value=fpformat.fix(valueAsFloat, 0) # Write back (increased) value to node (provided by the SimulationToolkit) scriptinterface.updateValue(".1.3.6...",value,"CONST") # ---------------------------------- end of jython script ---------------- It works when done inside a DOS-Box running Jython as seen above. But the script itself results in: File "D:\AdventNet\simulator\mibs\_behavior_scripts_\script.py", line 2, in ? ImportError: no module named fpformat Exception while executing the Python Script which is loged in a log-file by the SimulationToolkit. In search of the solution the Tutorial, the "How to" and the FAQ left me unsuccessful and helpless. Has anybody any suggestion how to prevent this, i.e. how to be able to import? Or any hint how to convert an INT to a STRING without using this intricately solution? TIA for your help. Yours sincerely, Joern ____________________________________________________________ MicroNova electronic GmbH Joern Eckhoff Kommunikation und Telekommunikation Unterfeldring 17 D-85256 Vierkirchen Tel.: (08139) 93 00-63 Fax.: (08139) 93 00-80 E-Mail: Joe...@mi... WWW: http://www.micronova.de ____________________________________________________________ |
From: Adrian S. J. <as...@pa...> - 2001-07-20 08:24:38
|
> From: Paul Giotta > > I am currently have a side project that will do something like this. It > is a module that implements a telnet daemon that runs as a java thread. > When someone connects, it starts a jython interpreter and uses this as > the shell for user interaction. Thus, if this is embedded in a running > server, you can connect using an ordinary telnet client and manipulate > object running in the same VM. This is still work in progress, but some > of the sticky points so far: > > - Implementing telnet: I tried to find a java telnet daemon that I > could adapt or borrow code from. There does not seem to be any yet. Also > getting complete and understandable documentation for the telnet protocol > is not that easy (every time I use a new telnet client, it starts trying > to negotiate some other connection parameter that i cannot find in any > documentation). I've implemented telnet-like daemons in C++ and Smalltalk. The one thing I have learnt is that if you don't offer any telnet option codes, the clients tend not to try to negotiate anything. The other thing you can do is just send a WONT in response to any option you don't understand that the client sends as a DO, and a DONT when you're sent a WILL. > - If I try to run multiple instances of jython interpreters in > different threads, bad things start to happen. It is not really critical > that I handle multiple connections simultaneously, but I would not expect > this to be a problem. :-( What sort of problems? I've just got a mud-like engine running with multiple interpreters each in their own thread, and had very few problems. The hardest thing I had to do was to redirect stdout/stderr back to the telnet connection, as it seems that Jython 2.0 grabs stdout/stderr at the point that you initialise it, rather than just using Java's stdout. > -Paul Adrian. |
From: Paul G. <pau...@so...> - 2001-07-20 08:02:20
|
I am currently have a side project that will do something like this. It = is a module that implements a telnet daemon that runs as a java thread. = When someone connects, it starts a jython interpreter and uses this as=20 the shell for user interaction. Thus, if this is embedded in a running=20 server, you can connect using an ordinary telnet client and manipulate=20 object running in the same VM. This is still work in progress, but some = of the sticky points so far: - Implementing telnet: I tried to find a java telnet daemon that I=20 could adapt or borrow code from. There does not seem to be any yet. Also= =20 getting complete and understandable documentation for the telnet protoco= l=20 is not that easy (every time I use a new telnet client, it starts trying= =20 to negotiate some other connection parameter that i cannot find in any=20 documentation). - There has to be a way to get references to the other objects that=20 you want to manipulate. This can be as simple as placing references to=20 all of the objects that you want to manipulate into a hashtable that is = statically initialized or available through a singleton. It just need to= =20 be done in advance, otherwise the jython interpreter winds up more or=20 less isolated from the rest of the application. - If I try to run multiple instances of jython interpreters in=20 different threads, bad things start to happen. It is not really critical= =20 that I handle multiple connections simultaneously, but I would not expec= t=20 this to be a problem. :-( AFAIK it is also possible to remotely connect to a running VM using the = Java debugging API (if the VM was started with debugging options on), so= =20 if you go this route, you do not need to provide your own interpreter in= =20 that VM, but jython might be helpful in making a simple client. The idea of the project above is to do more high level interaction, like= =20 reconfiguration, at runtime. -Paul > I am experimenting with Jython at the moment. I am impressed. > I was wondering if any jython-guru's have used it to debug Java code. > I guess you could run the Jython interpretor in a seperate thread to t= he > program you're trying to debug. You could then stop the thread from=20 jython > and inspect the state of its attributes and test calling some of the > methods. > This would be very handy for experimenting with swing gui's. > Has anybody experimented with some of the Java debugger api's? It may = even > be possible to set break points on particular methods. > Any Ideas would be appreciated. > Thanks, > Greg. |
From: Pavel T. <pau...@ya...> - 2001-07-19 21:44:07
|
Kevin, By running your long task in invokeLater() you explicitly ask for running your task in AWT Event dispatching thread (the same thread that updates GUI). Just call your long task in timer (with no invokeLater) and GUI must update. If you need some data computed by your long tasks to redraw the gui you must synchronize an access to them explicitly. Hope this helps, Pavel --- Kevin McNamee <qk...@lm...> wrote: > > I am trying to use threads so that I can revalidate > some panes while > performing a series of long tasks, i.e. > > long task > update & revalidate pane > long task > update & revalidate pane > etc. > > This would be done in a loop. I have tried several > things: > > synchronize module > ------------------ > This is used with the notify() & wait() methods. > While there are seperate > threads they are not running concurrently. This is > no good, What I need is > synchronous threads. A good example at > http://groups.yahoo.com/group/jpython/message/1641 > > swing.Timer > ----------- > More promising. I started a timer to update the GUI > every 5 seconds and > ran long tasks as > swing.SwingUtilities.invokeLater(task). However, > this > didn't work. It seems the timer is blocked until the > task is completed > (demo attached). > > SwingWorker Class > ----------------- > ? > > > Can someone point me in the right direction here? > Any good examples,links? > > > Any help appreciated, > Kevin > > > > _________________________________________________ > Name/Title : Kevin McNamee, Software Consultant > Phone : +46 13 32 1165 > E-Mail : kev...@er... > > > > from pawt import swing, awt > from java.io import * > from java.lang import Runtime, Runnable > > class GUI: > def __init__(self): > self.timer = None > button = swing.JButton("Start", > actionPerformed=self.do_task) > self.frame = swing.JFrame("Test", > windowClosing=self.do_quit) > self.frame.getContentPane().add(button) > self.frame.setSize(awt.Dimension(100,100)) > self.frame.visible = 1 > > > def do_task(self, event): > if self.timer != None: > self.timer.stop() > self.timer = swing.Timer(1000, repeater()) > self.timer.start() > swing.SwingUtilities.invokeLater(longTask()) > > def do_quit(self, event): > import sys > sys.exit(0) > > class repeater(awt.event.ActionListener): > def actionPerformed(self, evt): > print "Timer Expired" > > class longTask(Runnable): > def run(self): > print "Doing long task" > proc = Runtime.getRuntime().exec('find / -name a') > stdin = proc.getInputStream() > isr = InputStreamReader(stdin) > br=BufferedReader(isr) > line = br.readLine() > while line != None: > line = br.readLine() > print "Finished long task" > > GUI() > > # End of script > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ |
From: <bc...@wo...> - 2001-07-19 21:37:48
|
[Russo, Tom] >Thanks, that's very helpful. However, how about this: when I change the >"import socket" line to: > >interp.exec("import os") > >I get: > ><snip> >Root cause: >Traceback (innermost last): > File "", line 1, in ? >java.lang.ExceptionInInitializerError: java.lang.NullPointerException ></snip> > >I assume that this is a different problem? Is there a fix for this one? Yes, it is fixed in jython-2.1a1. As a workaround you can assign a value to sys.prefix before importing "os". The exception is thrown because sys.prefix is null. regards, finn |
From: Russo, T. <to...@st...> - 2001-07-19 20:27:27
|
Thanks, that's very helpful. However, how about this: when I change the "import socket" line to: interp.exec("import os") I get: <snip> Root cause: Traceback (innermost last): File "", line 1, in ? java.lang.ExceptionInInitializerError: java.lang.NullPointerException </snip> I assume that this is a different problem? Is there a fix for this one? thanks _t -----Original Message----- From: bc...@wo... [mailto:bc...@wo...] Sent: Thursday, July 19, 2001 3:50 PM To: 'jyt...@li...' Cc: Russo, Tom Subject: Re: [Jython-users] jython.jar useable when not on classpath? [Russo, Tom] >I'm having some trouble using jython from within a jsp page. >... Take a look at how PyServlet.java attempts so solve the problem > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/util /PyServlet.java?rev=1.11&content-type=text/vnd.viewcvs-markup The lines of special interest is: sys.add_classdir(rootPath + "WEB-INF" + File.separator + "classes"); sys.add_extdir(rootPath + "WEB-INF" + File.separator + "lib"); It allows *package* import from the WEB-INF/lib and WEB-INF/classes directories. Note that the problem you are seeing have nothing to do with class loading. The problem occurs because jython needs to know if the package "org.python" is (part of) a valid java package. >I'm running >Tomcat 3.2.2, jython 2.0, ... Unfortunately the add_classdir and add_extdir was added in jython-2.1a1. >I guess the ultimate question is: is it possible to use jython.jar when it's >not on the classpath? You can always tell jython about the java packages that is available manually: sys.add_package("org.python.core") sys.add_package("java.lang") sys.add_package("java.io") ... regards, finn |
From: <bc...@wo...> - 2001-07-19 19:48:48
|
[Russo, Tom] >I'm having some trouble using jython from within a jsp page. >... Take a look at how PyServlet.java attempts so solve the problem > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/util/PyServlet.java?rev=1.11&content-type=text/vnd.viewcvs-markup The lines of special interest is: sys.add_classdir(rootPath + "WEB-INF" + File.separator + "classes"); sys.add_extdir(rootPath + "WEB-INF" + File.separator + "lib"); It allows *package* import from the WEB-INF/lib and WEB-INF/classes directories. Note that the problem you are seeing have nothing to do with class loading. The problem occurs because jython needs to know if the package "org.python" is (part of) a valid java package. >I'm running >Tomcat 3.2.2, jython 2.0, ... Unfortunately the add_classdir and add_extdir was added in jython-2.1a1. >I guess the ultimate question is: is it possible to use jython.jar when it's >not on the classpath? You can always tell jython about the java packages that is available manually: sys.add_package("org.python.core") sys.add_package("java.lang") sys.add_package("java.io") ... regards, finn |
From: Russo, T. <to...@st...> - 2001-07-19 19:18:40
|
Hi, I'm having some trouble using jython from within a jsp page. I'm running Tomcat 3.2.2, jython 2.0, java 1.3.1 and Win2K. The following code demonstrates the error: <%@ page import="org.python.core.*" %> <%@ page import="org.python.util.PythonInterpreter" %> <% PythonInterpreter interp = new PythonInterpreter(); // Tell jpython where to find importable modules. This is a bit of a hack. interp.exec("import sys"); interp.exec("sys.path.append('C:\\jython\\.')"); interp.exec("sys.path.append('C:\\jython')"); interp.exec("sys.path.append('C:\\jython\\Lib')"); PyList path = (PyList)interp.eval("sys.path"); //interp.exec("import socket"); //<--- this line causes the error %> <html> <head><title>test</title></head> <body> <%= path %> </body> </html> When executed as is, the output is: ['.', 'C:\\jython\\.', 'C:\\jython', 'C:\\jython\\Lib'] which is as expected. However, if I uncomment the line interp.exec("import socket"); I get: <snip> Error: 500 Internal Servlet Error </snip> <snip> Root cause: Traceback (innermost last): File "", line 1, in ? File "C:\jython\Lib\socket.py", line 13, in ? ImportError: No module named python </snip> The offending line in socket.py is: import org.python.core This module should be loaded from jython.jar, which is in the WEB-INF\lib folder of my web application. jython.jar is not on the classpath; rather it gets loaded by the jsp server when this page is requested. When I put jython.jar on the classpath, everything works fine. I'd rather not do that though, because it prevents me from zipping everything into an exportable .war file. I'm setting sys.path manually because it doesn't seem to be set. I guess the ultimate question is: is it possible to use jython.jar when it's not on the classpath? I've read that there were some problems with jpython.jar and class loaders. I changed to jython.jar but the problems don't seem to have gone away. Does anyone know a fix for this? thanks much _t |
From: Dameron M. <dam...@ro...> - 2001-07-19 16:00:25
|
on Thu, Jul 12, 2001, daChosen said something like: >There seem not to be any materials on setting up the back-end >(Zope-MySQL) for Jython/Java development. > AFAIK, Zope is python only, with perl a recent addition. (It's written in python, with some C sprinkled around.) Cheers, Dameron |
From: D-Man <ds...@ri...> - 2001-07-19 15:58:54
|
On Thu, Jul 19, 2001 at 03:57:38PM +0200, Kevin McNamee wrote: | | I am trying to use threads so that I can revalidate some panes while | performing a series of long tasks, i.e. | | long task | update & revalidate pane | long task | update & revalidate pane | etc. Ok. You have this loop in a thread (some subclass of java.lang.Thread). When you want to update the GUI you update it via the SwingUtilities class. Ex : class MyThread( java.lang.Thread ) : def run( self ) : for ... : ... # now update the GUI, create an java.lang.Runnable that # does the work class updater( java.lang.Runnable ) : def run( self ) : <update the gui here> if javax.swing.SwingUtilities.isEventDispatchThread() : # we are already in the AWT_EventQueue thread, it is # safe to touch the GUI updater().run() else : # request that the updater be run in the # AWT_EventQueue thread javax.swing.SwingUtilities.invokeLater( updater() ) HTH, -D |
From: Kevin M. <qk...@lm...> - 2001-07-19 14:35:54
|
On Thu, 19 Jul 2001, Kevin McNamee wrote: > threads they are not running concurrently. This is no good, What I need is > synchronous threads. A good example at Of course I mean "What I need are asynchronous threads". _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: Kevin M. <qk...@lm...> - 2001-07-19 13:57:45
|
I am trying to use threads so that I can revalidate some panes while performing a series of long tasks, i.e. long task update & revalidate pane long task update & revalidate pane etc. This would be done in a loop. I have tried several things: synchronize module ------------------ This is used with the notify() & wait() methods. While there are seperate threads they are not running concurrently. This is no good, What I need is synchronous threads. A good example at http://groups.yahoo.com/group/jpython/message/1641 swing.Timer ----------- More promising. I started a timer to update the GUI every 5 seconds and ran long tasks as swing.SwingUtilities.invokeLater(task). However, this didn't work. It seems the timer is blocked until the task is completed (demo attached). SwingWorker Class ----------------- ? Can someone point me in the right direction here? Any good examples,links? Any help appreciated, Kevin _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: Greg L. <Gr...@da...> - 2001-07-19 05:05:25
|
I am experimenting with Jython at the moment. I am impressed. I was wondering if any jython-guru's have used it to debug Java code. I guess you could run the Jython interpretor in a seperate thread to the program you're trying to debug. You could then stop the thread from jython and inspect the state of its attributes and test calling some of the methods. This would be very handy for experimenting with swing gui's. Has anybody experimented with some of the Java debugger api's? It may even be possible to set break points on particular methods. Any Ideas would be appreciated. Thanks, Greg. |
From: <bc...@wo...> - 2001-07-18 20:43:21
|
I am happy to announce the second alpha release of Jython 2.1. Jython is a Java implementation of the Python programming language. It allows users to compile Python source code to Java byte codes, and run the resulting bytecodes on any Java Virtual Machine. It is a very seamless and smooth integration with Java: from Python you have complete access to all Java libraries, can build applets, can integrate with Java beans, and can subclass Java classes in Python and vice versa. Like Python, and unlike Java, Jython can also be used interactively: just type some Jython code at the prompt and see the results immediately. A java installer is available for download at the Jython website: http://www.jython.org/ Installation on version 2.1a2 is similar to version 2.0. Further information and tips on installation is available at: http://www.jython.org/install.html Jython 2.1 aims to be feature compatible with Python 2.1 and among the new feature are: - Nested scopes - The display hook A complete list of changes and differences are available here: http://www.jython.org/NEWS.html A list of fixed bugs can be found here: http://sourceforge.net/tracker/?group_id=12867&atid=112867 Change the Status input box to "Closed" and the Group input box to "Fixed in 2.1a2" and press the "Browse" button. Bugs can be reported to the bug manager on SourceForge: http://sourceforge.net/bugs/?group_id=12867 Cheers, the jython-developers |
From: D-Man <ds...@ri...> - 2001-07-18 20:35:00
|
On Wed, Jul 18, 2001 at 11:48:49AM -0700, Alan Littleford wrote: | D-Man, | | thanks -- after I posted my message I realised I was suffering from a | caffeine-inadequacy -- JYthon is, of course, doing _exactly_ the right thing | and my brain was fogged. Makes you wonder: :-). | I suspect some of my confusion (and some others I have seen on the | mailing list) come from the Jython/Python/Java overlap. Some of it is just habit -- once you do something several times (like casting, if you have been doing a bunch of Java work) you keep on trying to do it even though it isn't correct anymore (once you revert to Jython). It happens to me a lot when I am translating code from one to the other and I forget to make a change in a few places. -D |
From: Alan L. <al...@li...> - 2001-07-18 18:51:39
|
D-Man, thanks -- after I posted my message I realised I was suffering from a caffeine-inadequacy -- JYthon is, of course, doing _exactly_ the right thing and my brain was fogged. Makes you wonder: Should one think of Jython as a turbo/typeless-java Should one think of Jython as Python with escape hatches to Java Should one think of Jython as Jython and forget its origins I suspect some of my confusion (and some others I have seen on the mailing list) come from the Jython/Python/Java overlap. Thanks again Alanl -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of D-Man Sent: Wednesday, July 18, 2001 11:40 AM To: Jython-users Subject: Re: [Jython-users] Class casting .... On Wed, Jul 18, 2001 at 10:33:14AM -0700, Alan Littleford wrote: | Now, of course, in Java I can setJ(p) and cast: (P)getJ() to get a | P back. Yes, this ugly hack is required to work around the static type checking. | In Jython however I always get a J back from getJ() and I | would seem to have no way of 'casting' it up to my Python subclass. Jython uses dynamic typing just like CPython so if you really have something that is of type 'P' then it really is of type 'P' and you can simply use it. Casts are not needed becuase python/jython is smart enough to figure out the type on its own (at runtime, of course). HTH, -D _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |
From: D-Man <ds...@ri...> - 2001-07-18 18:40:11
|
On Wed, Jul 18, 2001 at 10:33:14AM -0700, Alan Littleford wrote: | Now, of course, in Java I can setJ(p) and cast: (P)getJ() to get a | P back. Yes, this ugly hack is required to work around the static type checking. | In Jython however I always get a J back from getJ() and I | would seem to have no way of 'casting' it up to my Python subclass. Jython uses dynamic typing just like CPython so if you really have something that is of type 'P' then it really is of type 'P' and you can simply use it. Casts are not needed becuase python/jython is smart enough to figure out the type on its own (at runtime, of course). HTH, -D |
From: D-Man <ds...@ri...> - 2001-07-18 18:35:46
|
On Wed, Jul 18, 2001 at 05:48:34PM +0000, Mark Robinson wrote: | cheers, I had intended to send it to the list, but I just cocked it all up | ;) | | What I am actually trying to do is in order to gain some familiarity with | jython I am rewriting a java prog I have in a book in jython. In the java | example it was typed exactly as in my first example i.e. | | g2 = (Graphics2D)g Ok, In jython that would be spelled g2 = g | it seems to work in java...guess I will have to keep tinkering to work out | how jython wants to do it If Java didn't give you a ClassCastException then then Jython should work just fine with it. Try adding print g.__class__ to see what class (type) g really is, prior to trying to use a Graphics2D method on it. -D |
From: Mark R. <blo...@ho...> - 2001-07-18 17:48:42
|
cheers, I had intended to send it to the list, but I just cocked it all up ;) What I am actually trying to do is in order to gain some familiarity with jython I am rewriting a java prog I have in a book in jython. In the java example it was typed exactly as in my first example i.e. g2 = (Graphics2D)g it seems to work in java...guess I will have to keep tinkering to work out how jython wants to do it blobby From: D-Man <ds...@ri...> >To: Mark Robinson <blo...@ho...> >Subject: Re: [Jython-users] type conversions to Graphics2D >Date: Wed, 18 Jul 2001 13:29:20 -0400 > >On Wed, Jul 18, 2001 at 10:18:14AM -0700, Mark Robinson wrote: >| This message was sent from Geocrawler.com by "Mark Robinson" ><blo...@ho...> >| >| >| I apologise if I send this twice, but I don't >| think my first attempt worked. > >Well, the first time had a little bit less information ;-). Neither >copy was sent to the list though, and I don't know if that was your >intent. > >| The problem here is that I don't already have a >| Graphics2D object I have a graphics object that I >| want to cast to a Graphics2D object. In order to >| be able to use the Graphics2D API I have to some >| how cast the Graphics object passed to paint() by >| default to a Graphics2D object, but I can't figure >| out quite how. > >Casting won't help here either. In Java it would blow up with a >ClassCastException and in C/C++ you would just get weird data >corruption. THis is becaues casting doesn't actually do any >conversion, it only changes what the compiler thinks you have. > >You need to do some research on Graphics2D objects and see if you >can't create one from a Grahics object. I haven't used those >classes myself so I'm not sure. > >HTH, >-D _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |
From: Alan L. <al...@li...> - 2001-07-18 17:36:06
|
I apologize ahead of time if this is an RTFM thing (or I'm just dumb) but .... I'm given some Java classes (sadly not in source) . Lets say I have class J and I subclass it in Jython: class P(J): ........... amongst the Java is a class that has getter and setter classes of type J: public class J2 { .. public J getJ() { } public void setJ(J j) { } } Now, of course, in Java I can setJ(p) and cast: (P)getJ() to get a P back. In Jython however I always get a J back from getJ() and I would seem to have no way of 'casting' it up to my Python subclass. Am I missing something purely obvious here ?? Thanks for JYthon -- as a long-time Python fan I am in hog heaven with this stuff .. Alan |
From: Joseph C. <jca...@in...> - 2001-07-18 17:19:48
|
Samuele, Ahhhh, I think that I understand now, (I have been working other examples of the code on my end). I think the fundamental difference that I failed to pick up on originally was the following: You have > PyObject obj = instance.__findattr__("n"); Where as (which I didn't oringally include) I have in my code... I missed the fact that you were using the instance to get the method. > PyMethod obj = (PyMethod) class.__findattr__("n"); ~ An now I say I see the light.... First problem... solved. I am still working on the "Memory Leak" example, as it may just be my poor code causing the trouble. Thanks very much for your help so far, I will be back in touch. Joe -- "Every new beginning comes from some other beginnings end." -- Semisonic ----------------------------------------------------- Joseph Campbell | EMAIL: joe...@in... Staff Consultant | URL: www.inventa.com Inventa Technologies | PH: (856)914-5224 | CELL: (609)972-0297 ----------------------------------------------------- |