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-11-26 09:46:28
|
[Danny Yoo] >I've been experimenting with jythonc, and one of my experiments was to >play around with Java interfaces. In the course of my experiments, I've >been running my head into a strange AttributeError. > >Since I'm not too familiar with Jython, I'll report the steps I've done in >some detail; forgive me if much of this is extraneous! It is exactly the right amount of detail. Thank you for that. >The error message >is at the very bottom, and this message traces what I've done to get the >message. > >I have the following Java interface: [snipped a traditional use of jythonc which works] >And this worked! > >However, I ran into problems when I tried playing with my classes in >Jython. To force Jython to use my jythonc-compiled classes, I made a new >directory called "scratch". Here's the log: > >... >Jython 2.1a3 on java1.3.0_02 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import Doubler >>>> Doubler ><jclass Doubler at 5868800> >>>> d = Doubler() >>>> d.eval(42) >Traceback (innermost last): > File "<console>", line 1, in ? >AttributeError: abstract method "eval" not implemented >### > >I'm just scratching my head on this one. Are Jythonc-compiled classes >reusable from Jython itself? Short answer: no. It is because "Doubler" is partly a java class and partly a python module. To see Doubler function as a python module you can use this trick: import Doubler Doubler.moduleDictInit(Doubler.__dict__) d = Doubler.Doubler() print d.eval(42) There is no trick to make Doubler appear as a java class. The code that does that is located at the bottom half of Py.initProxy() and can't be called directly. regards, finn |
From: Edward P. <epo...@te...> - 2001-11-26 08:57:16
|
Thanks, lol, I have only been using Jython for a week ... having a blast. I still haven't got used to finding solutions that are ridiculously simple :) This is a little simpler that writing my own class loader! -Ed ----- Original Message ----- From: "dman" <ds...@ri...> To: <jyt...@li...> Sent: Sunday, November 25, 2001 7:15 PM Subject: Re: [Jython-users] Resticting access > On Sun, Nov 25, 2001 at 06:21:24PM -0800, Edward Povazan wrote: > | Hi, > | > | I had been writing a simple script language, and in looking for a run time > | environment (as opposed to writing my own interpreter) I discovered my > | expressions were exactly the same as Python expressions (with a little > | overloading). > | So I decided to use Jython instead ... why reinvent the wheel? > | I will still parse the a python subset to make sure the user (typically a > | non programmer) doesn't do something silly. > | But I want a version for the more adventurous users. > | > | How do I restrict Jython use of 'import xxx' and 'from xxx import yyy' > > This one is easy : > > simply hook in your own function as __import__. > > > The 'import' statement is simply syntactic sugar : > > import foo > > foo = __import__( "foo" ) > > > from foo import bar > > bar = __import__( "foo" ).bar > > > import foo as bar > > bar = __import__( "foo" ) > > > You can (in pure python code) do something like the following : > > > import __builtin__ # this is the namespace where built-in stuff is > real_import = __builtin__.__import__ # save the real function for later > def my_import( name , globals , locals , fromlist ) : > print "Yo, the user wants to import '%s'" % name > return real_import( name , globals , locals , fromlist ) > __builtin__.__import__ = my_import # hook in my function instead > > > In your function you can determine whether or not to allow the import > or raise ImportError. > > HTH, > -D > > -- > > Religion that God our Father accepts as pure and faultless is this: to > look after orphans and widows in their distress and to keep oneself from > being polluted by the world. > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <sp...@is...> - 2001-11-26 08:27:35
|
Hi again Robert! >> Has anybody >> any idea on how to solve this? > > Specify python.home (The directory that contains Jython's "Lib"=20 > directory) > with the -D switch (you can add this to the Jython startup script- > jython.bat on windows, jython on *nix). Here's an example of the = switch > > -Dpython.home=3D/path/to/jython > > If python.home is not set propertly, Jython cannot read the registry=20= > file > for additional settings and will not find it's Lib directory. If the > Jython.jar file has not moved from its installed location, it can = figure > things out on its own; otherwise, you must give jython hints as to how=20= > to > find its Lib directory. Setting python.home is best. You can also > explicitly add paths to sys.path in scripts (not a great way to go). I have actually solved my problems by calling "sys.path.add(...)". With=20= this command erverything went fine. I think I have just misunderstood=20 the use of the java properties "sys.path", etc. Thanks :) -- S=E9bastien. |
From: <sp...@is...> - 2001-11-26 08:19:44
|
Hi Robert! Thank you for having some interest in this annoying problem -=20= I'm really happy to get support :) > > My only half-baked idea for your situation is to see if explicit = package > discovery helps at all. sys.add_package("packagename") gives the > packagemanager hints about what is a java package. Maybe using > sys.add_package("net.sourceforge.spedit.app") is good for something. This works, but the problem is the same: Jython is unable to access=20 net.sourceforge.spedit.app.Application. > Does using jython's -v switch give any useful hints? No, the error is still this "AttributeError", and there is no other=20 valuable information displayed. Actually I have tried with a Linux JDK=20= and the error does not occur, I have also tried with Jython2.0 insted of=20= the current 2.1a3, both had the same behaviour. So basically the error=20= is due to a different behaviour in MacOS X JDK. If I want to submit a bug report to Apple, I have to understand what the=20= actual problem is. Obviously Jython is able to locate the package and=20 introspect it, proof is the result of the=20 dir("net.sourceforge.spedit.app") that returns the actual content of the=20= package. The problem is that Jython is not able to access the content of=20= this package when using the "." (and also every package that I have=20 defined outside of the jre/lib/ext equivalent on OS X). I suspect a=20 difference in the introspection mechanisms between the Jython attribute=20= access and the dir() function. The problem is that to understand why=20 Jython is unable to access the Application class I need to know how=20 Jython works at its core...maybe some experts could help? Cheers, -- S=E9bastien. |
From: dman <ds...@ri...> - 2001-11-26 03:16:01
|
On Sun, Nov 25, 2001 at 06:21:24PM -0800, Edward Povazan wrote: | Hi, | | I had been writing a simple script language, and in looking for a run time | environment (as opposed to writing my own interpreter) I discovered my | expressions were exactly the same as Python expressions (with a little | overloading). | So I decided to use Jython instead ... why reinvent the wheel? | I will still parse the a python subset to make sure the user (typically a | non programmer) doesn't do something silly. | But I want a version for the more adventurous users. | | How do I restrict Jython use of 'import xxx' and 'from xxx import yyy' This one is easy : simply hook in your own function as __import__. The 'import' statement is simply syntactic sugar : import foo foo = __import__( "foo" ) from foo import bar bar = __import__( "foo" ).bar import foo as bar bar = __import__( "foo" ) You can (in pure python code) do something like the following : import __builtin__ # this is the namespace where built-in stuff is real_import = __builtin__.__import__ # save the real function for later def my_import( name , globals , locals , fromlist ) : print "Yo, the user wants to import '%s'" % name return real_import( name , globals , locals , fromlist ) __builtin__.__import__ = my_import # hook in my function instead In your function you can determine whether or not to allow the import or raise ImportError. HTH, -D -- Religion that God our Father accepts as pure and faultless is this: to look after orphans and widows in their distress and to keep oneself from being polluted by the world. |
From: dman <ds...@ri...> - 2001-11-26 03:02:33
|
On Sun, Nov 25, 2001 at 09:07:00PM +0100, Andreas Schlapbach wrote: | Hi List | | I hope this is not a FAQ, but I get a following Exception | | NameError: java | | What is jython trying to tell me here? You need to put import java before trying to use a member of that package. -D -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas |
From: Edward P. <epo...@te...> - 2001-11-26 02:21:22
|
Hi, I had been writing a simple script language, and in looking for a run time environment (as opposed to writing my own interpreter) I discovered my expressions were exactly the same as Python expressions (with a little overloading). So I decided to use Jython instead ... why reinvent the wheel? I will still parse the a python subset to make sure the user (typically a non programmer) doesn't do something silly. But I want a version for the more adventurous users. How do I restrict Jython use of 'import xxx' and 'from xxx import yyy' My ideas are 1) catch things within my parser or 2) write a classloader and use it to load jython. The classloader would allow only classes that I deem safe. 1) is possible but will 2) work. Does jython pull any magic tricks to get around java security? If not 2) seems to be the best way. Has anyone out there had to dealt with this before? Thanks -Ed |
From: Andreas S. <sch...@ia...> - 2001-11-25 20:58:22
|
Hi List I hope this is not a FAQ, but I get a following Exception NameError: java What is jython trying to tell me here? Thanks Andreas |
From: Robert W. B. <rb...@di...> - 2001-11-25 20:27:32
|
Hi S=E9bastien, I didn't see a reply to this, so thought I'd give $0.02. On Tue, 20 Nov 2001, S=E9bastien Pierre wrote: > Hi all, > > I would like to know if it was possible to make jythonc warn the use= r > at compile time when interfaces are not fully implemented by Python > classes. Possible? yes. Likely? no. > For example if I implement the List interface and I forget the > add method, then it would be nice that the compiler warns me that I hav= e > missed something in the source code. Python, and thus Jython, are designed to be dynamic. Your "add" method could appear at runtime, making the compiler check undesirable. Also, remember that Python does not do compile-time protocol checking, an= d Jython is based on Python. When Python adds this, that is when it will b= e pursued for Jython. -robert |
From: Robert W. B. <rb...@di...> - 2001-11-25 18:35:48
|
Note: moved to jython-users On Fri, 23 Nov 2001 bri...@ma... wrote: > Each time I run Jython, I receive errors as Jython tries to cache every > single jar file (elaborated below). The problem is that ,since these > files are never cached, the launch of Jython is delayed each time as > Jython each launch attempts to cache them and fills standard out with > the chronology of the attempts. Even worse, if I launch Jython from a > command string in Applescript which I often do, I must filter out all > the these errors on the return string in order to get to the information > returned by Jython. I think these messages are warnings. This means you can avoid them by setting the python.verbose property to "error" either with Java's -D switch (-Dpython.verbose=error) or in jython's registry file. You might loose useful info though. > Since I use Jython as a GUI in OSX because it > supports Java 2 natively in OSX as opposed to Python TK which requires > hacks to run X Windows, I find this very disappointing. I have tried to > figure out where Jython is attempting to cache these interpreted jars so > that I might change permissions which might be hindering this, but I > have not been successful. Check the registry setting "python.cachedir". This is where it is trying to write the cache. By default it is the directory "cachedir" in the sys.prefix directory (jython's installation directory). Look for "cachedir" in the directory where jython is installed and chmod there. > Do you have any hints you can pass on to me? Only to find cachedir and change permissions, and possibly change the python.verbose property. > A search of the user groups has yielded nothing on this subject. > Here are the errors: Ugh, that's one long list! > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/classes. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/classes. > jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/ui.jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/ui.jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/i18n.jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/i18n.jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/sunrsasign. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/sunrsasign. > jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Java/Extensions/CoreAudio.jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Java/Extensions/CoreAudio.jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Java/Extensions/QTJava.zip' > *sys-package-mgr*: can't write cache file for > '/System/Library/Java/Extensions/QTJava.zip' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jcert. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jcert. > jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jnet. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jnet. > jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jpda. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jpda. > jar' > *sys-package-mgr*: processing modified jar, > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jsse. > jar' > *sys-package-mgr*: can't write cache file for > '/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/jsse. > jar' |
From: Robert W. B. <rb...@di...> - 2001-11-25 18:05:10
|
Note: moved to jython-users On Fri, 23 Nov 2001, Bhavani wrote: > Here I am making use of BioPython Api to fetch the Gene details > thro NCBI Database server. If it is in Python environment it works > fine. But If I convert that Python class to Java class using the > Jython tool and try to run java (python) class it is throwing an > exception Disclaimer: I'm unqualified to comment on BioPython specifically. I assume "Jython tool" means jythonc, and that "Python environment" means running as a script with jython rather that with CPython. Is that right? If so, it is likely just a bad/missing python.home when using the compiled classes. > Exception details are below: > --------------------------------------- > Error in GeneSearch > > Java Traceback: > > at org.python.core.Py.ImportError(Py.java) > at org.python.core.imp.importFromAs(Compiled Code) > at org.python.core.imp.importFrom(imp.java) > at GeneSearch$_PyInner.main$4(GeneSearch.java:169) > at GeneSearch$_PyInner.call_function(GeneSearch.java:58) > at org.python.core.PyTableCode.call(Compiled Code) > at org.python.core.PyCode.call(PyCode.java) > at org.python.core.imp.createFromCode(imp.java) > at org.python.core.Py.initProxy(Compiled Code) > at GeneSearch.__initProxy__(GeneSearch.java:227) > at GeneSearch.<init>(GeneSearch.java:205) > at GeneSearchTest.main(Compiled Code) > Traceback (innermost last): > File "D:\jython2.1\SampleProj\GeneSearch.py", line 0, in main > ImportError: cannot import name GenBank try printing your sys.path variable and the python.home property. If they are wrong, try setting python.home in the command line with Java's -D switch (-Dpython.home=D:\jython2.1). > ***** Here GenBank is present in Biopython API and is going to > installed seperately into python directory after installing python > I have installed the Biopython api in the Lib direcotry of python > and even updated the python.path to point to the respective > directory both in registry file of jython as well as the environmental > settings > > Can you suggest me what are other settings I have to make to > make use of BioPython along with Jython If you've compiled GeneSearch.py with jythonc without switches, try running it with something like this: java -Dpython.home=D:\jython2.1 -cp D:\jython2.1\jython.jar;. GeneSearch alternatively, you can statically compile the script so that you there's no need to rely on Jython's Lib. jythonc --deep --jar gs.jar GeneSearch.py java -cp gs.jar;D:\jython2.1\jython.jar GeneSearch If this is not helpful, reply with following info: 1. which jythonc switches you used 2. add debug print statements to look at python.home and sys.path, and include their output in your reply: import sys, java print sys.path print java.lang.System.getProperty("python.home") -robert |
From: dman <ds...@ri...> - 2001-11-25 17:11:41
|
On Sun, Nov 25, 2001 at 09:15:30PM +0800, Calvin (Hoi Wai) wrote: | Greetings, | I had written a python class which use Numeric Python module. Now, I | wish to write an applet to act as a interface for this class. But I | don't know how to put the Python Numeric modules into the applet. Did | anyone try it and solve it? Please feel free to discuss the suggestion. Your choices are : o don't use Numeric o rewrite Numeric in Java (or python) instead of C o rewrite the C sources to use JNI instead of Python's C API o build a distributed system where the Numeric-dependent stuff runs in CPython on a server and the applet invokes remote methods on it The problem is that Numeric is written in C using CPython's C Extension API. Since Jython is pure java code, it has no access to stuff written in C, unless you make it use JNI so that the JVM can access it. Of course, that defeats the purpose of an applet because you would need to compile it specifically for each system (OS/hardware combination, maybe even JVM version) that you want it to run on. Depending on your requirements and goals, I think either rewriting your stuff to not depend on any C modules, or building a distributed system (in python) will be the best routes. If you go with the distributed system, be aware that applets can only make connections back to the server they were downloaded from. That means your numeric server would need to be on that machine, or you would need a proxy server on that machine. Come to think of it, the main purpose (I think) of numeric is its performance with number crunching, and using a distributed system would kill that. -D |
From: Calvin (H. Wai) <ee...@st...> - 2001-11-25 13:14:15
|
Greetings, I had written a python class which use Numeric Python module. Now, I wish to write an applet to act as a interface for this class. But I don't know how to put the Python Numeric modules into the applet. Did anyone try it and solve it? Please feel free to discuss the suggestion. -Calvin P.S.: the attached file is the class I want to use on the applet |
From: Arun S. <ar...@sh...> - 2001-11-25 06:18:24
|
On Sat, Nov 24, 2001 at 10:47:24PM -0600, Robert W. Bill wrote: > On Thu, 22 Nov 2001, Arun Sharma wrote: > > I have a simple servlet, which does > > > > from java.lang import Class > > > > I'm pretty sure rt.jar is in the classpath, but my servlet for some > > reason gives me this error. > > > > What am I doing wrong ? > > > > -Arun > > I was unable to reproduce this. Could you give more details. Is it > Tomcat? 4.0? Jython 2.0? It's solved now. The problem turned out to be write permissions to WEB-INF/lib/cachedir. I've found that usually problems with cachedir lead to slow startup times, but in this case it affected correctness. Thanks! -Arun |
From: dman <ds...@ri...> - 2001-11-25 01:57:55
|
On one of my Debian woody boxes jythonc stopped working a while ago. Jython still worked, but running 'jythonc' would give no output. I have now solved the problem, but I think it involves a bug in jython. I traced through how jythonc was supposed to be run -- it is pretty straightforward : jython is run with /usr/share/jython/Tools/jythonc/jythonc.py as the first argument (and any other arguments are passed to the script). I added a print to the top of jythonc.py, but it wouldn't get printed. It was really strange because I could create a "hello world" program and it would work. As I took a deeper look, looking at main.py I noticed that there were several Form Feed characters in it. I removed those (from the other source files as well) but those had no bearing on my problem. (I don't think there is a reason to have form feeds anyways, unless perhaps one intends to "cat <source> > /dev/lp0" with an old printer) The solution, as it turned out, was to open each of the source files, convert them to utf-8 and save them again. What difference does it make to jython whether a (python) source file is saved in latin1 or utf-8? In any case, I think it is a gross error to simply terminate with no message when encountering a file that it doesn't like. I started the conversion to utf-8 from main.py, and tried running jythonc after each file was changed. It would give me "ImportError" or "AttributeError" when an import of a non-converted file was encountered. Once I had converted all files jythonc worked properly. The interesting thing about jythonc's source files is that they all have the copyright symbol in a comment at the top of the file. In 'latin1' this is character 0xa9. I use (g)vim 6.0 as my editor. As you may already know it has two variables, 'enc' and 'fenc'. 'enc' is the global encoding specifier. I can set it to "latin1" or "utf-8" (and probably others, but I haven't tried them). 'fenc' is a setting that is local to the current buffer and specifies what encoding the file should be written as. I can set that to "latin1" or "utf-8" also. I created 4 files containing only the copyright symbol, each file with a different combination of 'enc' and 'fenc' settings. Interestingly enough, both files with 'fenc' set to "latin1" contained only 0xa9 0xa0 (when viewed with a hex editor). The file with enc=latin1, fenc=utf-8 contained 0xc2 0xa9 0xa0. The file with enc=utf-8, fenc=utf-8 contained 0x00 0x70 0xa0. I think this copyright character and its encoding may be the source of the whole problem. I'll check with the vim folks too regarding the differences in the two utf-8 files. Hmm, when I open them again, the utf8-utf8 file is messed up (shows ^@p) but the latin1-utf8 file is correct. I used latin1-utf8 as the settings when I converted the jythonc sources. -D |
From: dman <ds...@ri...> - 2001-11-25 01:23:26
|
On Tue, Nov 13, 2001 at 07:25:07PM +0000, Finn Bock wrote: | [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 Interesting. I also ran into the problem again when I tried to test our program on windows shortly before submission. The pickle module needs to have the file in "text" mode. I had changed it to binary as a result of the previous problems with using text mode. Of course, it worked beautifully both ways on Unix. | >| 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. Hehe. Honestly, though, I really don't understand why text files must be treated specially. Shouldn't there be a mode for fopen() to return a JPEG file or an MP3 file? Obviously not, so why should text be any different? I think that the system-level handling of files should consider a file as nothing more than a series of bytes. Their meaning should be left up to the application programmer, who will use routines to properly serialize in-memory data to and from the file. If one programmer wants the files to have CRLF periodically, then it is his job to wrap the file with a filter. Also, I think that text files should have a uniform format, just like JPEGs and other complex formats. It seems that text files are really the most complex, though they should be the simplest. <end mini rant> | >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. Oh, that's what those are supposed to mean. Usually I waste too much time trying to find the class that has the method I want (I hate writing loops to read data via byte array "out" arguments), then usually find out that the class is in the wrong hierarchy to use it where I want. (Can you tell that I dislike I/O in Java? System.out.println isn't too bad though.) | >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") Hmm, I think I would have to learn more about unicode in order to answer that. I would have thought that it should simply write out the bytes as it sees them since the file object isn't supposed to second-guess what the programmer really meant when he said to write that data. (continuation of views expressed above) Then it would be the programmer's job to know what the data (bytes) mean when they are read back in, not the file's job. This is where Java's proliferation of IO classes starts to make sense -- each class does the proper filtering of the stream according to some built-in rules. Then one should use the class that is appropriate for the data being read (ie unicode vs. ascii). (I don't think the javadoc explains that very well, though, since I never figured that out until you explained it above) | 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. No problem, you wouldn't have known :-). -D |
From: dman <ds...@ri...> - 2001-11-25 01:02:45
|
Hi Danny! On Mon, Nov 19, 2001 at 03:27:51PM -0800, Danny Yoo wrote: | I've been experimenting with jythonc, and one of my experiments was to | play around with Java interfaces. In the course of my experiments, I've | been running my head into a strange AttributeError. [implemented java interface with python class, compiled with jythonc ] | I'm just scratching my head on this one. Are Jythonc-compiled classes | reusable from Jython itself? Any help on this would be greatly | appreciated. Thank you! I just got jythonc to work again on my machine, so I tried out what you were doing (though I implmemented java.lang.Runnable instead). I got similar results, even when I added an "@sig" line to my python class. It does seem that the classes generated by jythonc are not directly usable in the interpreter. Instead, I guess just use the python source if the interpreter is being used directly, and the jythonc classes if you want to (appear to) do away with the interpreter. HTH, -D |
From: rohit s. <ro2...@ya...> - 2001-11-24 12:49:45
|
I am getting "java.lang.ExceptionInInitializationError: java.lang.NullPointerException at org.Python.core.PySystemState.<init>(PySystemState.java:158) at org.Python.util.PythonInterpreter.<init>(PythonInterpreter.java:67) at org.Python.util.PythonInterpreter.<init>(PythonInterpreter.java:45) at PyFactory.initialize(PyFactory.java 9) at A.run(A.java 9) The classes I am using are as follows(I have included only the required portion of the code):- CLASS A:- import java.util.*; public class A extends Thread{ public A(){ } public void run(){ try{ synchronized(this){ PyFactory.initialize(); PyFactory.getInterp().execfile("Python1.py"); PyFactory.getInterp().execfile("Python2.ghs"); } }catch(Exception e){ System.out.println("Exception1"+e); e.printStackTrace(); } } } CLASS B:- import java.util.*; public class B{ public static void main(String args[]){ A1 a1=new A1(); A1 a2=new A1(); a1.start(); a2.start(); } } PyFactory.java:- public class PyFactory{ private static PythonInterpreter pyInterp; public static void initialize() throws ClassNotFoundException{ pyInterp=new PythonInterpreter(); } public static PythonInterpreter getInterp(){ return pyInterp; } } Python1.py:- class ExecPython1: def __init__(self,b): self.test(b) def test(self,b): a="This is a test" print a print b Python2.ghs:- ExecPython1(1) Pl explain the cause of the error. When I am creating and running only one thread then it works fine. But with more than one threads, it gives this exception. Pl help!!!! I am sinking!!! Thanx in Advance! Rohit __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 |
From: <da...@cr...> - 2001-11-23 11:42:24
|
Hi Terry, I used to do vanilla java applets, haven't realy tried much with the python variety, but here's a quick explanation of applet loading in general. Anyone who _does_ use jython for applets please correct anything I've inferred wrongly! Compiled java class files are situated on the web server under a specific URL directory (often the same as the one serving the HTML, sometimes different). The location of the top-level java code directory is given in HTML as an attribute to the applet tag e.g. <applet codebase="http://mysite/codebase">. The web client will pass this info to it's java VM, which then invokes the VM classloader to pull the classes down over the network. Java package names are used to define an absolute path, so if the applet class is dave.funky.Animator then I put it on the web server to be accessed as http://mysite/codebase/dave/funky/Animator.class Any classes used by the client that won't be on the client's own classpath (typically anything outside of the java.something packages) has to be downloaded in this way, so if I'm using jython classes, I need to put the jython classes at http://mysite/codebase/org/python/ and so on for various packages in the jython set. (Some browser clients will allow jar files to be spec'd in the codebase too, this varies fromimplementation to implementation: some allow zip files, cab files, etc.. It's one part of browser compatibility hell, I'm afraid - no easy answers here.) As I see it, you could introduce jython via two routes: 1] precompile the jython applets with jythonc and place them on server as above - making suire all jython classes are available too. 2] Write an applet (in java or jython) that embeds a PythonInterpreter which can pull python code down off the network and execute it on the fly. How you deploy the python code is then up to you! From a quick look at the demos on the site, it looks like this is what the JythonLoader applet does. HTH Dave >Hi, > >I'm fairly experienced with Python (the C variety :)), >but Java is completely new territory, and -- all >technical merits aside -- I don't really want to learn >Java right now (at least not more than I have to). > >What interests me about Jython is the prospect of >developing client-side browser applets in Python. It >appears this does require a little Java knowledge, >so I'm wondering if anyone can tell me what the >"minimum-Java" path to that goal might be. > >I don't quite follow how the Jython example applets >at www.jython.org are loaded, for example. It says >it's loading the Jython library, but looking at the >"JythonLoader.java" source, I don't really see how/ >where it does this. I guess I'm looking for some >kind of blow-by-blow explanation for what happens >when a (Jython) applet is loaded, and the role of >the various files that have to be on the server for >it to work. > >I tried to find a simple explanation of this, but >most of the docs I found online seemed to assume >knowledge of Java applets. I realize that Java >enthusiasts might argue that I should just learn >Java, but then if I knew Java well, I'd probably be >less interested in Jython, right? > >Anyway, I'm hoping this exists somewhere and I just >haven't found it. Otherwise, you could explain it >to me and *I'll* write it up. :) Any help much >appreciated. > >Thanks! > >-- >------------------------------------------------------ >Terry Hancock >ha...@an... |
From: <sp...@is...> - 2001-11-23 10:45:48
|
I have made tests on a linux machine jdk-1.3.1/jython-2.1a3, I went fine=20= with both SPEdit.jar in jre/lib/ext and in local dir with -cp option. So=20= I can only conclude this is a MacOS X issue, but to submit a bug I have=20= to understand why. I do not know how Jython does to get access classes=20= in packages, but the think is that it is actually able to list the=20 content of the package but cannot access it. What are the difference=20 between the mechanims behind dir() and those involved in attributes=20 resolution? Cheers, -- S=E9bastien. |
From: <sp...@is...> - 2001-11-23 10:34:51
|
Le vendredi 23 novembre 2001, =E0 11:28 AM, Jan Wender a =E9crit : > On Fri, Nov 23, 2001 at 11:24:53AM +0100, S=E9bastien Pierre wrote: >> >> Jython 2.0 on java1.3.1 (JIT: null) >> Type "copyright", "credits" or "license" for more information. >>>>> import net.sourceforge.spedit.app >>>>> net.sourceforge.spedit.app.Application() >> Traceback (innermost last): >> File "<console>", line 1, in ? >> AttributeError: java package 'net.sourceforge.spedit.app' has no >> attribute 'Application' >> > Is it possible that the Application class depends on some other class?=20= > If so, > are the other classes also in the classpath? > No every dependency is packaged into the jar. I mean it works when I put=20= the jar in the Extensions directory...I cannot figure out why the=20 behaviour is different when I set the classpath manually. This obviously=20= isn't caused by the JDK as jython is able to list the package content. I=20= will try on another machine... Desperatly yours, -- S=E9bastien. |
From: <sp...@is...> - 2001-11-23 10:24:57
|
> At first you did use the wrong list. jython-dev is for development of=20= > jython > itself, your question belongs into jython-user. Secondly, you should=20= > mention > which jython and java versions you are using more prominently. It is = an > important information in order to assess your problem. Thanks for answering :) I was quite desperate as nobody has answered my=20= previous posts on jython-users, and it is not the first time it=20 happens.. So I did not found any alternative to direct posting to=20 jython-dev... I mentioned (in PS) that I was using jython-2.1a3, my=20 current JDK is MacOS X JDK 1.3.1- I have now switched to jython 2.0 > Did you look in jython-user archives? Perhaps somebody has had the = same=20 > problem. Yes, but I have not found anything... It's hard to make a query on that. > Are the classes java or jython classes? Are the files in the classpath=20= > or in > python.path resp.? If they are used from jython classes, did you=20 > compile your > program with jythonc with correct classpath set? The files are Java compiled files put in a jar. The sys-package-manager=20= finds the jar so this should be ok. As I said I can make a dir() on the=20= package name and it lists me the actual content of the package, but it=20= tells me this attribute error telling there is no Application attribute=20= in the package. The class is public, this is not a protection problem. After some experiment, putting my jar in /Library/Java/Extensions which=20= is the jre/lib/ext equivalent and starting jython interpreter I was able=20= to do : Jython 2.0 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import net.sourceforge.spedit.app >>> net.sourceforge.spedit.app.Application() >>> ...everything went fine (note: I switched back to jython 2 to see if the problem was still = there) Afterwards I tried another way, removing my package from the Extensions=20= and starting the jython interpreter with -cp SPEdit.jar, which is the=20= package containing my classes. So I made the following: Jython 2.0 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import net.sourceforge.spedit.app >>> net.sourceforge.spedit.app.Application() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: java package 'net.sourceforge.spedit.app' has no=20 attribute 'Application' This puzzles me really, because as I said: >>> dir(net.sourceforge.spedit.app) ['Application', 'AuthorDisplay', 'DBView', 'NavigationTree', '__name__'] So jython actually knows the package.. Any clues? Cheers, -- S=E9bastien. |
From: <bc...@wo...> - 2001-11-22 21:51:24
|
[Benjamin Lubin] >I've been unable to re-assigning sys.excepthook to a new function in order >to change the default top-level exception handler in the interpreter. (I >believe this is 2.1 functionality that has not yet been included). Correct. >Has anyone tried doing this/know a work around? In jython-21a3 you have to add your own toplevel try-except statement. sys.excepthook will be supported in the next release. regards, finn |
From: Arun S. <ar...@sh...> - 2001-11-22 19:56:52
|
I have a simple servlet, which does from java.lang import Class I'm pretty sure rt.jar is in the classpath, but my servlet for some reason gives me this error. What am I doing wrong ? -Arun |
From: <sp...@is...> - 2001-11-22 16:40:22
|
Hi all, I have eventually managed to add a search path using the=20 "sys.path.append" method, which did not override the default search=20 path. This should IMHO cited in the FAQ. I now run into a *weird* problem: I can import my package=20 "net.sourceforge.spedit.app", this package contains a class which is=20 "Application". Strangely I cannot import=20 "net.sourceforge.spedit.app.Application", nor instanciate it. When I do=20= a "dir(net.sourceforge.spedit.app)", I get "Application" in the list- so=20= obvisouly Jython has access to it. Here is the exact error I get : "AttributeError: java package 'net.sourceforge.spedit.app' has no=20 attribute 'Application'" I'm using jython 2.1a3. Cheers, -- S=E9bastien. |