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-11-15 18:24:40
|
Hi, This has to be one of the weirdest errors I've ever seen. I have a Python class that subclasses a Java class. The Java superclass has a class variable named user. Attempting to read it (ie, print self.user) in the Python subclass generates an exception with the message "Write-only attribute." Of what use a write-only attribute is to anybody is beyond me! I finally worked around it by writing an accessor method in Java. Sigh. Note: I even tried making the variable public in the Java class in case security was the problem. It wasn't. |
From: <bc...@wo...> - 2001-11-15 09:19:31
|
On Wed, 14 Nov 2001 09:40:24 -0800, you wrote: >Does anyone know how to suppress the message below, i.e., disable the >message from printing to screen? > >*sys-package-mgr*: processing new jar, 'whatever-name.jar' You can change the "python.verbose" property from the default "message" to "warning". It can be done on the commandline, in the registry file, in the $HOME/.jython file or in the system properties. jython -Dpython.verbose=warning regards, finn |
From: Edward P. <epo...@te...> - 2001-11-15 02:07:37
|
Doh! Nevermind. > Hi, > > I just started using Jython, mainly for hacking some of my GUI ideas. I > would like for my java System.out.println calls to send output to the jython > console. Does anyone know how to do this? > > Thanks > -Ed > |
From: Edward P. <epo...@te...> - 2001-11-15 02:02:37
|
Hi, I just started using Jython, mainly for hacking some of my GUI ideas. I would like for my java System.out.println calls to send output to the jython console. Does anyone know how to do this? Thanks -Ed |
From: Johnny P. <joh...@ho...> - 2001-11-14 17:40:35
|
Does anyone know how to suppress the message below, i.e., disable the message from printing to screen? *sys-package-mgr*: processing new jar, 'whatever-name.jar' _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
From: Lieyong Fu <LF...@Ce...> - 2001-11-13 21:07:07
|
You are right Robert. The classpath was the problem. Now it works. Thanks a lot. Lieyong -----Original Message----- From: Robert W. Bill [mailto:rb...@di...] Sent: Monday, November 12, 2001 7:05 PM To: Lieyong Fu Cc: 'jyt...@li...' Subject: Re: [Jython-users] Class path problem when embeding Jython from Java On Mon, 12 Nov 2001, Lieyong Fu wrote: > I'm embeding Jython script into my Java class. The interesting thing is that > my Java class "live in" the context of BEA Weblogic Server Domain. To be > specific, My classes are Session EJB beans. I.e. I'm embeding Jython from > Session EJB beans. > The problem I'm having is that I can not import Javax Classes like > Javax.naming.NamingException in the Jython which would have been OK had I > embeded the same Jython from a stand alone Java class (run the java class > from java command and give it a proper CLASSPATH) > I think the problem is that I need to programatically set the CLASSPATH for > Jython but I don't know yet how. Any help will be highly appreciated. > Thanks, > Lieyong Maybe try sys.add_package("javax.naming"), (if you haven't already). //import this import org.python.core.PySystemState; //before trying to import a class in javax.naming, do this PySystemState sys = Py.getSystemState(); sys.add_package("javax.naming"); //Then... interp.exec("import javax.naming.NamingException") The org.python.util.PyServlet.java file that comes with Jython is a good example of using sys.add_package as well as sys.add_extdir and sys.add_classdir. You may be seeing something similar to what required PyServlet to use the add_package calls. -robert |
From: <bc...@wo...> - 2001-11-13 19:59:48
|
[dman] >Having identified the use of a Python package as the previous source >of java->python interaction, I moved all the modules into one >top-level directory (non-package). > >Now I get the following : > >Traceback (most recent call last): > File "/home/dman/School/Architecture/project2/src/DemoFolder1.py", line 0, in make >TypeError: Default constructor failed for Java superclass AbstractFolder > > >This happens in the python code where the Folder class is >instantiated. I can change the base class of Folder to >java.lang.Object, and also comment out the entire __init__ method >(except for a 'pass' line) and I get the same result (with Object >instead of AbstractFolder as the superclass). > >I tried munging the jythonc-generated source a bit to remove calls to >super() and catching all throwables that __initProxy__ might throw, >and adjusting the superclass, but all resulted in the same error. > >Any ideas? Do yuo have a small self contained example? It will make it a lot easier to analyse. regards, finn |
From: <bc...@wo...> - 2001-11-13 19:27:23
|
[dman] >I have now identified the source of the problem and I think it is a >bug in jython/jythonc. > >... > >I then took the minimal sample that did work and put 2 of the python >... Could you please make a bugreport that includes the minimal sample. I have lost track of the issue and without a bugreport I can safely predict that the bug will never be fixed. regards, finn |
From: <bc...@wo...> - 2001-11-13 19:21:50
|
[dman] >The IMAP RFC states that all lines end in CRLF. When I printed out >the last 2 characters of sockfile.readline() I got something (the last >piece of data on the line), then 0xa. All the data was fine, except >that the CR was missing. Ok, I hope I understand the issue this time around. I agree that it looks strangely asymmetric for non-windows platforms. I have opened a bugreport but I have given it the lowest priority because I suspect that CPython will adopt a somewhat similar behaviour in 2.3. At the moment the python-dev people is discussing it in this patch. > http://sourceforge.net/tracker/?group_id=5470&atid=305470&func=detail&aid=476814 >| The basic issue is how to deal with characters (16-bits) vs. bytes >| (8-bit). Java have two ways: Stream and Reader, but python only have one >| open() method. I decided to override the 'b' flag for this behavior >| because many (windows) programmers would already know about the 'b' flag >| on the open() function. By re-using the 'b' flag the default text mode >| was obvious because that is what windows uses. > >Was the logic of input identical to text-files on windows, or is there >more to it than that? Not sure about the reason for the new-line algorithm; it isn't my design or code. I guess it is partly based on the windows way and partly on the way java handle line seperator when doing line reading. Maybe JimH have used a timemachine to implement a sane scheme for dealing with cross platform text files several years before CPython got around to it. >How does java decide what the encoding of the >data is (ie Unicode 16-bit chars or ASCII 8-bit chars)? Maybe I misunderstand the question, but java's Reader/Writer classes converts the file bytes to unicode characters while the Stream classes reads the file bytes as bytes. >How does it >decide to remove the CR, but not harm any other data in the stream? Java's readline() method(s) will remove all line-separator chars. Other read() calls does not remove CR. >I don't really understand much of Java's java.io package, other than >it takes some work to figure out which class has the method that does >what you want. IMO Python's read() and readline() methods are so much >simpler and get the job done just as well. No it doesn't. At least not when you try to combine unicode strings and file I/O. When you don't need unicode then I agree that CPython-1.5.2 was very simple to use. But in jython it is impossible to ignore the unicode problems because all our strings are always unicode enabled. Image that you have a string with a non-latin-1 character in it, a euro-sign for example. What should happen when we try to write that to a file? f.write(u"\u20AC") I can think of three answers. 1) Throw an ValueError exception. 2) Silently ignore the highorder byte and write \xAC to the file. 3) Convert the chars according to the platform codec and write the result. Cpython-2.0 uses #1 except it throws exceptions for all characters above 127. Jython uses #2 for binary files and #3 for textfiles. CPython have good technical reason for that choice, but I think the result is very bad and make for unnatural use of unicode strings. >I haven't forgotten because I never knew. I've only used Jython >= >2.0. (and CPython, but that is irrelevant here) My bad. regards, finn |
From: Robert W. B. <rb...@di...> - 2001-11-13 19:14:10
|
On Tue, 13 Nov 2001, Andreas Schlapbach wrote: > On Mon, 12 Nov 2001, Robert W. Bill wrote: > > On Mon, 12 Nov 2001, Andreas Schlapbach wrote: > > > Hi List ... > > What I'm expecting, is that I get an event as soon as I move the mouse > over a link, and print "Spam and eggs!" is displayed. But I don't see any > output, so I'm concluding that, either I have not implemented the correct > function or there's something fishy going on. I hope it's the former > though. > > I've implemented it in JAVA as well as in Piccola, a research scripting > lanugage at our University. What we are currently missing, is the > possibility to implement interfaces on the fly, as they require some > compilation. Therefore, I'm currently looking at your implementation for > inspiration. Setting JEditorPane=0 allows the mouse-over event when I try your sample code, until I add frames that is (I only really tested it with a couple html files, but I was hoping that was enough to help). -robert |
From: Joey G. <jo...@jo...> - 2001-11-13 17:11:18
|
I remember seeing something about this a while back, but I can't remember how to do it. Let's assume I'm in an interpreter and I've already written a bunch of test code, but there is a jar or directory that I need that I forgot to add to the classpath. How do I add it at that point? I thought it involved adding the jar name to the sys.path or something like that, but it doesn't seem to work. I'm using Jython 2.1b1 on Win2k. Thanks, Joey -- Sun Certified Java2 Programmer -- My Pocket Smalltalk Stuff: www.joeygibson.com/st -- -- "We thought about killin' him, but we kinda -- hated to go that far...." - Briscoe Darling |
From: Jeff E. <je...@ad...> - 2001-11-13 15:23:18
|
It seems the problem is with JEditorPane and the particular html used in the jython docs. If I feed the JEditorPane some more generic html, then it generates hyperlink events. I didn't investigate what about the jython doc page html the JEditorPane doesn't like. Andreas Schlapbach wrote: > Hi List > > I am looking at scripting languages based on the JVM and I must say I am > impressed of Jython. The feature that really interests me is the dynamic > creation of (JAVA) classes. Implementing interfaces is one application for > this technique. > > So to get to know a language, I allways try to implement this mini > help-browser (see attachment). In order to be able to browse, you have to > implement the HyperlinkListener. I have stared at this now for hours, and I > am allmost convinced it should work. However it does not. > > May be I am just blind, or I miss something. Could somebody take a look this. > > Thanks. > > Andreas > > P.S.: If you remove the <!-- --> comments in the Jython Docs, this could be > the start of a help browser for Jython (JEditorPane seems to allmost > supports HTML 3.2) > > > ------------------------------------------------------------------------ > > from java import awt > from pawt import swing > > class MyHyperlinkListener(swing.event.HyperlinkListener): > def __init__(self): > print "MyHyperlinkListener CStr" > > def hyperlinkUpdate(self,event): > print "Spam and eggs!" > > > def helpBrowser(url): > frame = swing.JFrame("Help Browser") > > panel = swing.JPanel() > > layout = awt.BorderLayout() > panel.setLayout(layout) > > urlField = swing.JTextField(30) > urlField.setText(url) > > toolBar = swing.JToolBar() > toolBar.add(urlField) > > jhtml = swing.JEditorPane() > jhtml.setPage(url) > jhtml.setEditable(1) > jhtml.addHyperlinkListener(MyHyperlinkListener()) > > jhtmlScrollPane = swing.JScrollPane(jhtml) > > statusBar = swing.JTextField() > statusBar.setEditable(1) > > panel.add(toolBar, "North") > panel.add(jhtmlScrollPane, "Center") > panel.add(statusBar, "South") > > frame.getContentPane().add(panel) > frame.pack() > frame.setSize(500,400) > frame.show() > > #adjust > helpBrowser("file:/home/schlpbch/jython/Doc/index.html") > > helpBrowser.py > > Content-Type: > > text/x-java > Content-Encoding: > > base64 > > |
From: Jeff E. <je...@ad...> - 2001-11-13 14:37:10
|
The javadoc for JEditorPane says, "EditorKit will generate hyperlink events if the JEditorPane is not editable" You are setting the JEditorPane's editable property to true. See if that helps. Also, you can call JEditorPane.getHyperlinkListeners and verify that your listener is added. The problem is not with your listener, but with forcing the JEditorPane to generate the event. Andreas Schlapbach wrote: > Hi List > > I am looking at scripting languages based on the JVM and I must say I am > impressed of Jython. The feature that really interests me is the dynamic > creation of (JAVA) classes. Implementing interfaces is one application for > this technique. > > So to get to know a language, I allways try to implement this mini > help-browser (see attachment). In order to be able to browse, you have to > implement the HyperlinkListener. I have stared at this now for hours, and I > am allmost convinced it should work. However it does not. > > May be I am just blind, or I miss something. Could somebody take a look this. > > Thanks. > > Andreas > > P.S.: If you remove the <!-- --> comments in the Jython Docs, this could be > the start of a help browser for Jython (JEditorPane seems to allmost > supports HTML 3.2) > > > ------------------------------------------------------------------------ > > from java import awt > from pawt import swing > > class MyHyperlinkListener(swing.event.HyperlinkListener): > def __init__(self): > print "MyHyperlinkListener CStr" > > def hyperlinkUpdate(self,event): > print "Spam and eggs!" > > > def helpBrowser(url): > frame = swing.JFrame("Help Browser") > > panel = swing.JPanel() > > layout = awt.BorderLayout() > panel.setLayout(layout) > > urlField = swing.JTextField(30) > urlField.setText(url) > > toolBar = swing.JToolBar() > toolBar.add(urlField) > > jhtml = swing.JEditorPane() > jhtml.setPage(url) > jhtml.setEditable(1) > jhtml.addHyperlinkListener(MyHyperlinkListener()) > > jhtmlScrollPane = swing.JScrollPane(jhtml) > > statusBar = swing.JTextField() > statusBar.setEditable(1) > > panel.add(toolBar, "North") > panel.add(jhtmlScrollPane, "Center") > panel.add(statusBar, "South") > > frame.getContentPane().add(panel) > frame.pack() > frame.setSize(500,400) > frame.show() > > #adjust > helpBrowser("file:/home/schlpbch/jython/Doc/index.html") > > helpBrowser.py > > Content-Type: > > text/x-java > Content-Encoding: > > base64 > > |
From: Andreas S. <sch...@ia...> - 2001-11-13 11:00:25
|
On Mon, 12 Nov 2001, Robert W. Bill wrote: > On Mon, 12 Nov 2001, Andreas Schlapbach wrote: > > Hi List > > > > I am looking at scripting languages based on the JVM and I must say I am > > impressed of Jython. The feature that really interests me is the dynamic > > creation of (JAVA) classes. Implementing interfaces is one application for > > this technique. > > > > So to get to know a language, I allways try to implement this mini > > help-browser (see attachment). In order to be able to browse, you have to > > implement the HyperlinkListener. I have stared at this now for hours, and I > > am allmost convinced it should work. However it does not. > > > > May be I am just blind, or I miss something. Could somebody take a look this. > > I gave it a try, and it seemed to work. At least it does everything > you ask of it. The hyperlinks are not implemented, and > there's no means of exiting the jvm on close, but that would be no > different in a similar Java implementation. > > Did you get an error? Did it behave differently than you expected? If it > did, how so? Have you implemented the same help browser in Java? What I'm expecting, is that I get an event as soon as I move the mouse over a link, and print "Spam and eggs!" is displayed. But I don't see any output, so I'm concluding that, either I have not implemented the correct function or there's something fishy going on. I hope it's the former though. I've implemented it in JAVA as well as in Piccola, a research scripting lanugage at our University. What we are currently missing, is the possibility to implement interfaces on the fly, as they require some compilation. Therefore, I'm currently looking at your implementation for inspiration. Any hint, where to look especially is warmly welcomed. Andreas -- I think, so IAM. Andreas Schlapbach sch...@kd... http://www.iam.unibe.ch/~schlpbch/ |
From: Arun S. <ar...@sh...> - 2001-11-13 06:34:57
|
Could you please make it execute: getServletContext().getRealPath("__init__.py") in the init() function ? -Arun |
From: Robert W. B. <rb...@di...> - 2001-11-13 03:51:14
|
On Mon, 12 Nov 2001, Andreas Schlapbach wrote: > Hi List > > I am looking at scripting languages based on the JVM and I must say I am > impressed of Jython. The feature that really interests me is the dynamic > creation of (JAVA) classes. Implementing interfaces is one application for > this technique. > > So to get to know a language, I allways try to implement this mini > help-browser (see attachment). In order to be able to browse, you have to > implement the HyperlinkListener. I have stared at this now for hours, and I > am allmost convinced it should work. However it does not. > > May be I am just blind, or I miss something. Could somebody take a look this. I gave it a try, and it seemed to work. At least it does everything you ask of it. The hyperlinks are not implemented, and there's no means of exiting the jvm on close, but that would be no different in a similar Java implementation. Did you get an error? Did it behave differently than you expected? If it did, how so? Have you implemented the same help browser in Java? -robert > Thanks. > > Andreas > > P.S.: If you remove the <!-- --> comments in the Jython Docs, this could be > the start of a help browser for Jython (JEditorPane seems to allmost > supports HTML 3.2) |
From: Robert W. B. <rb...@di...> - 2001-11-13 03:05:16
|
On Mon, 12 Nov 2001, Lieyong Fu wrote: > I'm embeding Jython script into my Java class. The interesting thing is that > my Java class "live in" the context of BEA Weblogic Server Domain. To be > specific, My classes are Session EJB beans. I.e. I'm embeding Jython from > Session EJB beans. > The problem I'm having is that I can not import Javax Classes like > Javax.naming.NamingException in the Jython which would have been OK had I > embeded the same Jython from a stand alone Java class (run the java class > from java command and give it a proper CLASSPATH) > I think the problem is that I need to programatically set the CLASSPATH for > Jython but I don't know yet how. Any help will be highly appreciated. > Thanks, > Lieyong Maybe try sys.add_package("javax.naming"), (if you haven't already). //import this import org.python.core.PySystemState; //before trying to import a class in javax.naming, do this PySystemState sys = Py.getSystemState(); sys.add_package("javax.naming"); //Then... interp.exec("import javax.naming.NamingException") The org.python.util.PyServlet.java file that comes with Jython is a good example of using sys.add_package as well as sys.add_extdir and sys.add_classdir. You may be seeing something similar to what required PyServlet to use the add_package calls. -robert |
From: Andreas S. <sch...@ia...> - 2001-11-12 21:55:51
|
Hi List I am looking at scripting languages based on the JVM and I must say I am impressed of Jython. The feature that really interests me is the dynamic creation of (JAVA) classes. Implementing interfaces is one application for this technique. So to get to know a language, I allways try to implement this mini help-browser (see attachment). In order to be able to browse, you have to implement the HyperlinkListener. I have stared at this now for hours, and I am allmost convinced it should work. However it does not. May be I am just blind, or I miss something. Could somebody take a look this. Thanks. Andreas P.S.: If you remove the <!-- --> comments in the Jython Docs, this could be the start of a help browser for Jython (JEditorPane seems to allmost supports HTML 3.2) |
From: Lieyong Fu <LF...@Ce...> - 2001-11-12 18:42:20
|
I'm embeding Jython script into my Java class. The interesting thing is that my Java class "live in" the context of BEA Weblogic Server Domain. To be specific, My classes are Session EJB beans. I.e. I'm embeding Jython from Session EJB beans. The problem I'm having is that I can not import Javax Classes like Javax.naming.NamingException in the Jython which would have been OK had I embeded the same Jython from a stand alone Java class (run the java class from java command and give it a proper CLASSPATH) I think the problem is that I need to programatically set the CLASSPATH for Jython but I don't know yet how. Any help will be highly appreciated. Thanks, Lieyong |
From: Samuele P. <ped...@bl...> - 2001-11-10 17:06:58
|
> [John Goerzen] > > >Tried, still didn't help.. > > > >Of note: when I print the loader of ListBO from within Python, it says > >com.lutris.classloader.MultiClassLoader. When I print the loader of > >the superclass of ListBOFoo from within Java (that superclass is the > >same ListBO), it says sun.misc.Launcher$AppClassLoader! More and more > >puzzling. > > That is because the BytecodeLoaders happens to search the > SyspathJavaLoader before searching the referent class loaders. It's a > bug. No, I would'nt say it is a bug. The problem is that the guilty class is loadable both by MultiClassLoader and probably from classpath. In those cases it is better if the user dis-entangle that, because , yes we can with good-will, change the order, but the only safe solution is to avoid that at all. Without knowing the specific up to the details, I will not change the actual order. regards. |
From: <bc...@wo...> - 2001-11-10 15:57:28
|
[Sebastien Delafond] >Hi, > >I have a very dummy Jython script, except.py, that does : > >except.py : >1: import java.lang.Exception >2: raise java.lang.Exception > >I then compile this to a standalone jar (jythonc --core --jar except.jar >except.py), that I call from another Java class; the call itself looks like >: > >try { > String jar = "./except.jar"; > URLClassLoader theLoader = new URLClassLoader(new URL[] { new URL("file:" >+ jar)}); > Object theLoadedClass = Class.forName("except", true, >theLoader).newInstance(); > String[] array = new String[] {}; > Method main = theLoadedClass.getClass(). > getMethod("main", new Class[] { array.getClass() }); > main.invoke(theLoadedClass, new Object[] {new String[] {}}); >} >catch (Throwable t) { > t.printStackTrace(); >} [A sidenote: when using the URLClassLoader I can't find the except$_PyInner class. I'll add a bugreport about that.] >The problem is that my "catch" actually doesn't catch the Exception I'm >throwing/raising from the jython script. It is because of the catch in Py.runMain(..): > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/core/Py.java?annotate=2.53#824 >... > >Thanks for any input, since I seem to be missing something obvious : I just >would like to be able to catch the exceptions raised from the python script, >in the java caller. I'm sure that's doable :) Not at the moment. I'll submit a bugreport. regards, finn |
From: dman <ds...@vm...> - 2001-11-09 22:06:45
|
This bounced last time. -D ----- Forwarded message from dman <ds...@ri...> ----- From: dman <ds...@ri...> Date: Fri, 9 Nov 2001 14:07:51 -0500 To: jyt...@li... User-Agent: Mutt/1.2.5i Mail-Followup-To: jyt...@li... On Fri, Nov 09, 2001 at 04:25:15PM +0000, Finn Bock wrote: | [dman] | | >Could someone please explain to me, again, why jython munges streams | >after the fashion of ms windows if binary mode isn't specified? | | First, was the problem the CR-NL munging or the non-ascii munging | <wink>? I assume you are running unix so it must have been be the | non-ascii munging that bit you. The IMAP RFC states that all lines end in CRLF. When I printed out the last 2 characters of sockfile.readline() I got something (the last piece of data on the line), then 0xa. All the data was fine, except that the CR was missing. | The basic issue is how to deal with characters (16-bits) vs. bytes | (8-bit). Java have two ways: Stream and Reader, but python only have one | open() method. I decided to override the 'b' flag for this behavior | because many (windows) programmers would already know about the 'b' flag | on the open() function. By re-using the 'b' flag the default text mode | was obvious because that is what windows uses. Was the logic of input identical to text-files on windows, or is there more to it than that? How does java decide what the encoding of the data is (ie Unicode 16-bit chars or ASCII 8-bit chars)? How does it decide to remove the CR, but not harm any other data in the stream? I don't really understand much of Java's java.io package, other than it takes some work to figure out which class has the method that does what you want. IMO Python's read() and readline() methods are so much simpler and get the job done just as well. | >I just had a real (annoying) waste of time tracking down why imaplib | >would throw an unexpected response exception | | Have you forgotton how JPython-1.1 did this? I haven't forgotten because I never knew. I've only used Jython >= 2.0. (and CPython, but that is irrelevant here) | Data was written as a through a Writer but reading data was through | a InputStream. With no way of changing that behaviour. What we have | now is better by far. Ok, I agree that allowing specifying the 'b' flag to make it work "right" is better than not allowing specification. (Personally, I think that all streams should just be streams with no magic munging under the programmer's feet. That is, I think that there should only be "binary mode" reading of files and sockets.) | >(on all correct | >responses, except UID responses), but worked beautifully with cpython. | >I am now submitting the patch below to cpython on sourceforge (that's | >where the module is maintained, right? I know that the debian package | >uses cpython's modules). | | It seems like this changes was submitted already: | | >http://sourceforge.net/tracker/?group_id=5470&atid=305470&func=detail&aid=469910 Yeah, Martin von Loewis responed that the bug has already been fixed in CVS and will be included in CPython 2.2. | I'll apply the same patch to jython's version of imaplib.py in the next | release. Cool. BTW, the current version of the Debian package includes the patch. -D ----- End forwarded message ----- |
From: Sebastien D. <sde...@ve...> - 2001-11-09 18:31:40
|
Hi, I have a very dummy Jython script, except.py, that does : except.py : 1: import java.lang.Exception 2: raise java.lang.Exception I then compile this to a standalone jar (jythonc --core --jar except.jar except.py), that I call from another Java class; the call itself looks like : try { String jar = "./except.jar"; URLClassLoader theLoader = new URLClassLoader(new URL[] { new URL("file:" + jar)}); Object theLoadedClass = Class.forName("except", true, theLoader).newInstance(); String[] array = new String[] {}; Method main = theLoadedClass.getClass(). getMethod("main", new Class[] { array.getClass() }); main.invoke(theLoadedClass, new Object[] {new String[] {}}); } catch (Throwable t) { t.printStackTrace(); } The problem is that my "catch" actually doesn't catch the Exception I'm throwing/raising from the jython script. On the other hand, I believe my Java call to execute the jar is legal, since if I do : except.java : 1: import java.lang.Exception; 2: public class except { 3: public static void main(String[] args) throws Exception { 4: throw new Exception(); 5: } 6: } and compile/jar that class into except.jar, then the exception is caught. Thanks for any input, since I seem to be missing something obvious : I just would like to be able to catch the exceptions raised from the python script, in the java caller. I'm sure that's doable :) --Sebastien ============================================================================ This message is intended only for the use of the Addressee(s) and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify pos...@ve... immediately. ============================================================================ |
From: Bruce M. <bmc...@in...> - 2001-11-09 18:06:41
|
Hi, I've had no problems with String arrays using jarray. Here's the URL on the Jython site: http://www.jython.org/docs/jarray.html Bruce -----Original Message----- From: cc...@ps... [mailto:cc...@ps...] Sent: Friday, November 09, 2001 9:51 AM To: jyt...@li... Subject: [Jython-users] best way to get byte[] ? Hi, i always have problems with java methods that take a byte[ ] array as an argument. Can somebody suggest a good way to get such an object? Thanks! Charlie _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <cc...@ps...> - 2001-11-09 17:41:38
|
Hi, i always have problems with java methods that take a byte[ ] array as an argument. Can somebody suggest a good way to get such an object? Thanks! Charlie |