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: <ma...@la...> - 2001-02-23 16:06:46
|
D-Man <ds...@ri...> said: > On Fri, Feb 23, 2001 at 12:42:08PM +0000, ma...@la... wrote: > | Adam Burke <ada...@gb...> said: > | > | > If you want to keep the unsorted data you need to take a copy, ie, y = x. > | > | Careful: y = x doesn't make a copy, it just assigns another > | name for the same list. Use y = x[:] to make a copy. > > That is only a shallow copy. If you modify the objects in list 'y' > afterwards, list 'x' will see the change. If you want a deep copy, > there is a module, "copy" I believe, to handle that. copy.deepcopy(x), yes. For the example given, a shallow copy would suffice, but in the general case, the above observation is pertinent. Mats |
From: D-Man <ds...@ri...> - 2001-02-23 14:59:46
|
On Fri, Feb 23, 2001 at 12:42:08PM +0000, ma...@la... wrote: | Adam Burke <ada...@gb...> said: | | > If you want to keep the unsorted data you need to take a copy, ie, y = x. | | Careful: y = x doesn't make a copy, it just assigns another | name for the same list. Use y = x[:] to make a copy. That is only a shallow copy. If you modify the objects in list 'y' afterwards, list 'x' will see the change. If you want a deep copy, there is a module, "copy" I believe, to handle that. -D |
From: <ma...@la...> - 2001-02-23 12:46:35
|
Adam Burke <ada...@gb...> said: > The JPython mailing list is technically retired now, I've copied > jython-users. > > sort() changes the state of the list so that it's sorted. > > >>> x = [ 'e', 'a', 'y', 'k', 'l' ] > >>> print x > ['e', 'a', 'y', 'k', 'l'] > >>> x.sort() > >>> print x > ['a', 'e', 'k', 'l', 'y'] > > If you want to keep the unsorted data you need to take a copy, ie, y = x. Careful: y = x doesn't make a copy, it just assigns another name for the same list. Use y = x[:] to make a copy. |
From: Adam B. <ada...@gb...> - 2001-02-23 05:26:23
|
The JPython mailing list is technically retired now, I've copied jython-users. sort() changes the state of the list so that it's sorted. >>> x = [ 'e', 'a', 'y', 'k', 'l' ] >>> print x ['e', 'a', 'y', 'k', 'l'] >>> x.sort() >>> print x ['a', 'e', 'k', 'l', 'y'] If you want to keep the unsorted data you need to take a copy, ie, y = x. Adam Burke www.gbst.com > -----Original Message----- > From: Steve Yegge [SMTP:st...@ca...] > Sent: Friday, February 23, 2001 3:19 PM > To: jpy...@py... > Subject: [JPython] problem with sort() > > rI've got a dictionary whose keys I want to print in sorted order. > If I call mydict.keys().sort(), the result is None: > > keys = self.spells.keys() > print "keys: ", keys > sorted = keys.sort() > print sorted > > results in: > > keys: ['curse spell', 'lightning bolt spell', ...] > None > > Do I have to make a copy of the keys list in order to sort it? > The python docs seem to suggest I can just slap a call to sort() > on the key set to iterate over it in sorted order. > > -steve > > > _______________________________________________ > JPython-Interest maillist - JPy...@py... > http://mail.python.org/mailman/listinfo/jpython-interest |
From: D-Man <ds...@ri...> - 2001-02-22 03:36:43
|
You created a /new/ JFrame instead of using the frame the applet gives you. JFrame, JDialog, JWindow (and maybe one other widget) all have heavyweight native peers. If you create one, you get a new native window. Instead try using the frame the applet already has. (I'm not sure where to find it, but try the Applet class's documentation) -D On Thu, Feb 22, 2001 at 11:46:29AM +0900, syKim wrote: | | however, when I executed it opens another applet window under appletviewer | or netscape.. | | main applet window in appletviewer or netscape is just empty. | | frame=JFrame('test',visible=1,size=(400,300)) ^^^^^^ |
From: syKim <re...@ne...> - 2001-02-22 02:45:19
|
Hi :) I'm trying swing programming in jython 2.0 I made simple text editor with InternalFrame however, when I executed it opens another applet window under appletviewer or netscape.. (It works on it but, not well) main applet window in appletviewer or netscape is just empty. what's problem on it? Source code : ---------------------------------------------------------------------------- ------------------------ import java from java.awt import * from java.awt.event import * from javax.swing import * from javax.swing.text import * class SmallEdit(JFrame): def exit(e) : java.lang.System.exit(0) frame=JFrame('test',visible=1,size=(400,300)) frame.getContentPane().setLayout(BorderLayout()) editor=JTextArea() editor.requestFocus() inner=JInternalFrame('newfile',1,1,1,1,visible=1) inner.setSize(200,150) scroll=JScrollPane(autoscrolls=1,preferredSize=(200,150)) port=self.scroll.getViewport() port.add(editor) inner.getContentPane().add('Center',scroll) desktop=JDesktopPane(preferredSize=(400,300)) desktop.add(inner) button = JButton('Exit',actionPerformed=exit) frame.getContentPane().add(desktop) frame.getContentPane().add('West',button) frame.pack() ---------------------------------------------------------------------------- -------------------------- |
From: Eli A. <el...@ce...> - 2001-02-20 06:30:33
|
Hi. I have inherited a Jython application that makes use of user-defined java time series classes. These classes have overloaded operators that do pretty much what you would expect. For instance, given a time series x and a time series y, x+y returns a new time series with the elements of x and y added at corresponding times. These usually work fine. It would be very useful to be able to define x>y the same way. However, when I write my own __cmp__ method Jython ignores it. The results from x>y are an arbitrary scalar value, as if I had left comparisons undefined. If I call my method directly by name: x.__cmp__(y) it works fine. Can anyone explain or point to a likely omission? Thanks, Eli |
From: Eli A. <el...@ce...> - 2001-02-20 06:04:52
|
Hi. I have inherited a Jython application that makes use of user-defined java time series classes. These classes have overloaded operators that do pretty much what you would expect. For instance, given a time series x and a time series y, x+y returns a new time series with the elements of x and y added at corresponding times. These usually work fine. It would be very useful to be able to define x>y the same way. However, when I write my own __cmp__ method Jython ignores it. The results from x>y are an arbitrary scalar value, as if I had left comparisons undefined. If I call my method directly by name: x.__cmp__(y) it works fine. Can anyone explain or point to a likely omission? Thanks, Eli |
From: Peter B. <bri...@ma...> - 2001-02-19 21:05:11
|
Hi! I've got a number of java .class files that I compiled from jython source code. Everything works fine under Linux and Solaris, but when I tried to run the same code on a Mac G3 (with the latest version of MRJ/SDK), I got the following error message: > Java Traceback: > > at org.python.core.Py.TypeError(Py.java:120) > at org.python.core.PyJavaInstance.noField(PyJavaInstance.java:65) > at org.python.core.PyInstance.__setattr__(PyInstance.java:318) > at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java:150) > at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java:61) > at org.python.core.PyJavaClass.__call__(PyJavaClass.java:786) > at pbj.jpy.MenuMaker$_PyInner.makeToolBars$5(MenuMaker.java:617) > ... > at org.python.core.Py.runMain(Py.java:798) > at pbj.jpy.pbjgraph.main(pbjgraph.java:867) > at com.apple.mrj.JManager.JMStaticMethodDispatcher.run(JMAWTContextImpl.java) > at java.lang.Thread.run(Thread.java) > > Traceback (innermost last): > > File "/home/18/brinkman/prog/java/train/pbjp/pbjgraph.py", line 0, in main > ... > File "/home/18/brinkman/prog/java/jpgui/MenuMaker.py", line 0, in makeToolBars > > TypeError: can't set arbitrary attribute in java instance: actionPerformed It appears that the line that caused the error looks like this: b=java.awt.Button('Label',actionPerformed=self.someMethod) I also installed jython on the Mac, and when I run the jython code via jython (without compiling it to .class files first), I don't get an error message, but nothing happens when I click on the buttons. Very confusing... Does anyone have any idea what's going on here? Thanks, Peter |
From: Sarwar R. <raz...@ya...> - 2001-02-19 15:18:12
|
I was able to fix my problem using Jaroslav's registry file fix. Thanks! I am trying desparately to NOT have to specify jarfile locations in my classpath (i.e. in my autoexec.bat or .login file). I'd rather supply them as command line args. say, I heard a while back that O Rieley was doing a vol. on JPython? Whatever became of that? any references for a good tutorial online? Thanks -Sarwar Raza --- Finn Bock <bc...@wo...> wrote: > [Sarwar Raza] > > >Hi.. > >I posted a similar problem a few days ago. I have > >tried adding the application specific jars to my > >classpath (referring to the jars themselves and not > >just their directories) but the jpyton interpreter > >_will not_ pick them up. > > Strange, it works fine for me. Note that the name of > the .jar files > added to CLASSPATH envvar must be with lowercase > ".jar". > > F.ex my classpath looks like this: > > CLASSPATH=i:\java\jdk1.3\jre\lib\rt.jar;i:\java\Jython.CVS\jython.jar;i:\java\in > fobus1.2\infobus.jar;I:\java\jaxp1.0.1\jaxp.jar;i:\java\jaxp1.0.1\parser.jar;i:\ > java\jakarta-tomcat-4.0-m5\bin\servlet.jar > > and the classes in all the .jars listed can be > loaded as expected. > > >The only jars cached by the > >package manager are those in the ..JRE/lib/ext > >directory. This is a serious problem for me. Any > help > >would be much appreciated. > > > >Some additional detail: > >the jpython modules are run within a jpython > >interpreter embedded within the application. i.e. > >there is no CLI. > > Can you load the classes from a command prompt? Does > the application set > its own classpath when starting and thus ignoring > the CLASSPATH envvar? > > >I create a jpython interpreter object > >and pass it the name of the module to run. If any > of > >these modules contain and 'import from' clause for > a > >package from a jar _not_ contained witin > >../JRE/lib/ext, the package manager _will not_ pick > >them up. I can go crazy importing > java.util.Hashtable > >or javax.util.Timer for example, but cannot import > >from com.foo.bar unless foobar.jar is in > >../JRE/lib/ext. I need to change this so that I can > >load libs from a custom directory. > > As a workaround you can add the packages to the > package cache by doing a > > sys.add_package("com.foo.bar") > > from within the python module before doing > > from com.foo.bar import Baz > > regards, > finn > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users ===== ************************* Sarwar S Raza NMS Software Engineer CommWorks Corporation http://www.wpi.edu/~sraza ************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: <bc...@wo...> - 2001-02-19 14:29:33
|
[Jaroslav Gergic] >Thank you Robert and all, now all is working fine... > >... and I have another one question for you: >What exactly (from the servlet programers point of view) >do following lines (PyServlet.init())? From the servlet programers POV its just a bit magic that can be ignored by everyone. > Can something be wrong with the following lines?: > ---from PyServlet--- > PySystemState sys = Py.getSystemState(); > sys.add_package("javax.servlet"); > sys.add_package("javax.servlet.http"); > sys.add_package("javax.servlet.jsp"); > sys.add_package("javax.servlet.jsp.tagext"); > ---end--- > >I was tracing the source code until PackageManager.makeJavaPackage(), >but I was completely lost there ;) Lets step away from the implementation for a while. A problem that Jython have to solve one way or another, is to detect that some name (say "javax") is a java package. The java API for this did not exists in JDK1.1 and even in JDK1.2 the support weak. So Jython tries to scan all the .jar and .zip files that it can find and from the class names of the classes found calculates that "javax" must be a java package. In JPython-1.0.X the standard java package names was listed in the registry and *any* non-standard package name (like "org.mycompany") had to be added to the package database manually. The sys.add_package was one such way of manually telling Jython of a known java package name. Today the only situation where it is required to call sys.add_package is when the a jar file is loaded by an alternative classloader, which is the case of the servlet.jar file under tomcat 4.0m5. regards, finn |
From: Jaroslav G. <j_g...@ya...> - 2001-02-19 10:57:58
|
Thank you Robert and all, now all is working fine... ... and I have another one question for you: What exactly (from the servlet programers point of view) do following lines (PyServlet.init())? > > Can something be wrong with the following lines?: > > ---from PyServlet--- > > PySystemState sys = Py.getSystemState(); > > sys.add_package("javax.servlet"); > > sys.add_package("javax.servlet.http"); > > sys.add_package("javax.servlet.jsp"); > > sys.add_package("javax.servlet.jsp.tagext"); > > ---end--- I was tracing the source code until PackageManager.makeJavaPackage(), but I was completely lost there ;) Regards Gergic __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Samuele P. <pe...@in...> - 2001-02-18 23:30:30
|
A little warning: [Daniel Lord] > Bruce Eckels (a Jython-god in training it seems), has a full chapter on > Jython in his "Thinking Patterns" book -- you can find a link to it on the > jython.org page near the bottom. In that chapter, Bruce points out that the > documentation strings are in the code, but no one (ahem! Attention: an > oversight jython crew?) extracted them with javadoc. > > He describes the following method to create jython documentation: > > <TI Patterns text> > Jython 2.0, for some reason, is distributed with only minimal API > documentation. In fact, only PythonInterpreter has the Java documentation > created for it. The Java documentation strings are there for the rest of the > classes, but they weren't extracted. Although many of the classes are not > necessary in order to program with Jython, many are and so it's valuable to > run Javadoc in order to generate the HTML documentation. > This just my opinion but also - I think - a necessary warning. It is not a final jython developers statement on this. Only PythonInterpreter javadoc is extracted because is the only interface that will be clearly supported and its considered to be stable or should evolve in a manner to keep things working. It is clear that other interfaces should reach this status, and for example that constructing and using basic methods on Lists or Dictionary from java side should be ok etc or creating extensions. The FAQ contains some useful info on this. We are working on a preexistent codebase - where there are things that are public and should better be protected or private, and other that have a poor interface if for external use. What is really needed is something like CPython Extending and Embedding Python/C API manuals that defines what is intended for external use, but this involves also much decisions and sometime redesign. So AFIAK don't hold your breath. But contributions and discussions in this direction are welcome. On the other hand there is no intention of changing things just for fun but some changes maybe required to improve jython, fix bugs or keep up with python development. I imagine it is ok to extract doc to learn basic things about PyObject, PyList and PyDictionary but then for the moment is up to the user to figure out what will last and what could possibly change or is just internal logic (the FAQ can help for this). And one should accept that code using undocumented APIs can be broken by future releases. And sadly and badly the presence of a javadoc comment may but does not mean - by now - documented API, sorry. My advice is to keep the java<->jython code interface as simple as possible on the java side, and to do the complicated interface things on jython side, because it is both easier and more stable. Given the temporary lack of clean API doc, if one needs to do complicated things, it is better to post something and ask on jython-dev, for topics not covered by the FAQ. regards, Samuele Pedroni. |
From: <da...@br...> - 2001-02-18 21:37:59
|
Bruce Eckels (a Jython-god in training it seems), has a full chapter on Jython in his "Thinking Patterns" book -- you can find a link to it on th= e jython.org page near the bottom. In that chapter, Bruce points out that t= he documentation strings are in the code, but no one (ahem! Attention: an oversight jython crew?) extracted them with javadoc. He describes the following method to create jython documentation: <TI Patterns text> Jython 2.0, for some reason, is distributed with only minimal API documentation. In fact, only PythonInterpreter has the Java documentation created for it. The Java documentation strings are there for the rest of = the classes, but they weren=92t extracted. Although many of the classes are n= ot necessary in order to program with Jython, many are and so it=92s valuabl= e to run Javadoc in order to generate the HTML documentation. Here is the makefile that I used to create the Java documentation: all: javadoc -sourcepath C:\Progtools\Jython\ \ -d C:\ProgTools\Jython\docs\new \ org.python.core org.python.modules \ org.python.util org.python.rmi You=92ll have to adjust the paths to fit your own installation. The sourc= epath is where you installed Jython, and =96d indicates the destination directo= ry for the generated HTML files. Look up the JDK online documentation for Javadoc for further details. Once you generate the documentation, you can poke through and pick up a f= ew bits and pieces you wouldn=92t otherwise find. </TI Patterns text> I assume this works from the command line as well in Unix and Windows. I am about to try this myself (after I finish a few weekend tasks) so I cannot say for certain it works, but Bruce has proved to be very reliable. BTW, I recommend you read the whole chapter--Bruce is an excellent instructor--he makes the arcane seem simple. I learned more on one exampl= e in that chapter than I did with the whole of the jython examples and FAQ.= I also recommend his Thinking in Java and Thinking in C++ as well. -- Daniel Lord -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of jyt...@li... Sent: Sunday, February 18, 2001 12:02 PM To: jyt...@li... Subject: Jython-users digest, Vol 1 #71 - 1 msg Send Jython-users mailing list submissions to jyt...@li... To subscribe or unsubscribe via the World Wide Web, visit http://lists.sourceforge.net/lists/listinfo/jython-users or, via email, send a message with subject or body 'help' to jyt...@li... You can reach the person managing the list at jyt...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Jython-users digest..." Today's Topics: 1. PythonInterpreter Documentation (Robert Welch) --__--__-- Message: 1 Date: Sun, 18 Feb 2001 07:53:55 -0500 From: Robert Welch <rob...@ho...> Organization: @Home Network To: Jython <Jyt...@li...> Subject: [Jython-users] PythonInterpreter Documentation Folks: Can someone point me to some web documentation for the PythonInterpreter Java class? I've wound up at: http://www.jython.org/docs/api/org.python.util.PythonInterpreter.html and there's some stuff there, but the Contents, Package & Help links all seem to be broken. This means I can't find any info on the "core" classes, such as org.python.core.PyObject. Thanks, ---Rob Welch --__--__-- _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users End of Jython-users Digest |
From: Robert W. <rob...@ho...> - 2001-02-18 12:45:13
|
Folks: Can someone point me to some web documentation for the PythonInterpreter Java class? I've wound up at: http://www.jython.org/docs/api/org.python.util.PythonInterpreter.html and there's some stuff there, but the Contents, Package & Help links all seem to be broken. This means I can't find any info on the "core" classes, such as org.python.core.PyObject. Thanks, ---Rob Welch |
From: Eli A. <el...@ce...> - 2001-02-17 19:01:11
|
Hi. I have inherited a jpython application that makes use of user-defined java time series classes. These classes have overloaded operators that do pretty much what you would expect. For instance, given a time series x and a time series y, x+y returns a new time series with the elements of x and y added at corresponding times. It would be very useful to be able to define x>y the same way. However, when I write my own __cmp__ method jpython ignores it. The results from x>y are an arbitrary scalar value, as if I had left comparisons undefined. If I call my method directly by name: x.__cmp__(y) it works fine. Any advice? |
From: <bc...@wo...> - 2001-02-16 18:13:46
|
[Jaroslav Gergic] >> >Thak you for the tip! I will optionally upgrade - >> >> The change that brian describe is in org.python.util.PyServlet. Since >> you can't possible be using this class (because it is completely new) >> you will not find any benefits by upgrading. Unless you also begin to >> use org.python.util.PyServlet. > >Yes, I checked CVS and PyServlet seems also interesting >to me. I downloaded and compiled it but I can not >make it working I am constantly getting: > >[error] >---sample--- >from javax.servlet.http import HttpServlet Yes, this line was missing from the example in the PyServlet.java source. >class hello(HttpServlet): >... >---end--- > >I get: >javax.servlet.ServletException: No callable (class or function) named >hw in D:\develo\tomcat3.2b6\webapps\hello\hw.py > >(the script should probably evaluate to a single node...?) The .py servlet class must have the same name as the python source. The source must be called hello.py for the example to work. >*** >I is interesting for me, because my application (python based >templates in Java + Tomcat) >works normally using the CLASSPATH trick described earlier. >I think there is some subtle difference between my CLASSPATH >handling and PyServlet classpath handling. >Can something be wrong with the following lines?: >---from PyServlet--- > PySystemState sys = Py.getSystemState(); > sys.add_package("javax.servlet"); > sys.add_package("javax.servlet.http"); > sys.add_package("javax.servlet.jsp"); > sys.add_package("javax.servlet.jsp.tagext"); >---end--- This is needed because servlet.jar isn't available on the classpath when used with tomcat. Without these lines, import javax.servlet would not work. regards, finn |
From: Robert W. B. <rb...@di...> - 2001-02-16 17:24:22
|
Hello Jaraslav, On Fri, 16 Feb 2001, Jaroslav Gergic wrote: > > >Thak you for the tip! I will optionally upgrade - > > > > The change that brian describe is in org.python.util.PyServlet. Since > > you can't possible be using this class (because it is completely new) > > you will not find any benefits by upgrading. Unless you also begin to > > use org.python.util.PyServlet. > > Yes, I checked CVS and PyServlet seems also interesting > to me. I downloaded and compiled it but I can not > make it working I am constantly getting: > > javax.servlet.ServletException: Could not create Jython > servletTraceback (innermost last): > File "D:\develo\tomcat3.2b6\webapps\hello\hw.py", line 1, in ? > NameError: javax > > (I am testing Hello World servlet distributed with PyServlet:) > ---sample--- > class hello(HttpServlet): > def doGet(self,req, res): > res.setContentType("text/html"); > out = res.getOutputStream() > print >>out, "<html>" > print >>out, "<head><title>Hello World, How are we?</title></head>" > print >>out, "<body>Hello World, how are we?" > print >>out, "</body>" > print >>out, "</html>" > out.close() > return > ---end--- > > It also does not work even when I try to write > "class hello(javax.servet.http.HttpServlet)" > > and in case I try to import the interface: > > ---sample--- > from javax.servlet.http import HttpServlet > > class hello(HttpServlet): > ... > ---end--- You are correct, the import and base class is required. > I get: > javax.servlet.ServletException: No callable (class or function) named > hw in D:\develo\tomcat3.2b6\webapps\hello\hw.py The class name and file name need to match. Much like class hello would be defined in hello.java, Jython's class hello(HttpServlet) should be in a hello.py file. Remember PyServlet uses: PyObject cls = interp.get(name); and "name" is the filename without the extension. > (the script should probably evaluate to a single node...?) > > *** > I is interesting for me, because my application (python based > templates in Java + Tomcat) > works normally using the CLASSPATH trick described earlier. > I think there is some subtle difference between my CLASSPATH > handling and PyServlet classpath handling. > Can something be wrong with the following lines?: > ---from PyServlet--- > PySystemState sys = Py.getSystemState(); > sys.add_package("javax.servlet"); > sys.add_package("javax.servlet.http"); > sys.add_package("javax.servlet.jsp"); > sys.add_package("javax.servlet.jsp.tagext"); > ---end--- > > Anyway - PyServlet is good idea, I planned to write > something similar myself in the future, > and PyServlet saves me some time. > I hope I will get this thing working soon too. It's only moments away... -Robert |
From: Jaroslav G. <j_g...@ya...> - 2001-02-16 16:46:33
|
> >Thak you for the tip! I will optionally upgrade - > > The change that brian describe is in org.python.util.PyServlet. Since > you can't possible be using this class (because it is completely new) > you will not find any benefits by upgrading. Unless you also begin to > use org.python.util.PyServlet. Yes, I checked CVS and PyServlet seems also interesting to me. I downloaded and compiled it but I can not make it working I am constantly getting: javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last): File "D:\develo\tomcat3.2b6\webapps\hello\hw.py", line 1, in ? NameError: javax (I am testing Hello World servlet distributed with PyServlet:) ---sample--- class hello(HttpServlet): def doGet(self,req, res): res.setContentType("text/html"); out = res.getOutputStream() print >>out, "<html>" print >>out, "<head><title>Hello World, How are we?</title></head>" print >>out, "<body>Hello World, how are we?" print >>out, "</body>" print >>out, "</html>" out.close() return ---end--- It also does not work even when I try to write "class hello(javax.servet.http.HttpServlet)" and in case I try to import the interface: ---sample--- from javax.servlet.http import HttpServlet class hello(HttpServlet): ... ---end--- I get: javax.servlet.ServletException: No callable (class or function) named hw in D:\develo\tomcat3.2b6\webapps\hello\hw.py (the script should probably evaluate to a single node...?) *** I is interesting for me, because my application (python based templates in Java + Tomcat) works normally using the CLASSPATH trick described earlier. I think there is some subtle difference between my CLASSPATH handling and PyServlet classpath handling. Can something be wrong with the following lines?: ---from PyServlet--- PySystemState sys = Py.getSystemState(); sys.add_package("javax.servlet"); sys.add_package("javax.servlet.http"); sys.add_package("javax.servlet.jsp"); sys.add_package("javax.servlet.jsp.tagext"); ---end--- Anyway - PyServlet is good idea, I planned to write something similar myself in the future, and PyServlet saves me some time. I hope I will get this thing working soon too. Regards Gergic BTW: I consider Jython based servlets much more flexible than JSPs... ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: <bc...@wo...> - 2001-02-16 14:54:57
|
[Sarwar Raza] >Hi.. >I posted a similar problem a few days ago. I have >tried adding the application specific jars to my >classpath (referring to the jars themselves and not >just their directories) but the jpyton interpreter >_will not_ pick them up. Strange, it works fine for me. Note that the name of the .jar files added to CLASSPATH envvar must be with lowercase ".jar". F.ex my classpath looks like this: CLASSPATH=i:\java\jdk1.3\jre\lib\rt.jar;i:\java\Jython.CVS\jython.jar;i:\java\in fobus1.2\infobus.jar;I:\java\jaxp1.0.1\jaxp.jar;i:\java\jaxp1.0.1\parser.jar;i:\ java\jakarta-tomcat-4.0-m5\bin\servlet.jar and the classes in all the .jars listed can be loaded as expected. >The only jars cached by the >package manager are those in the ..JRE/lib/ext >directory. This is a serious problem for me. Any help >would be much appreciated. > >Some additional detail: >the jpython modules are run within a jpython >interpreter embedded within the application. i.e. >there is no CLI. Can you load the classes from a command prompt? Does the application set its own classpath when starting and thus ignoring the CLASSPATH envvar? >I create a jpython interpreter object >and pass it the name of the module to run. If any of >these modules contain and 'import from' clause for a >package from a jar _not_ contained witin >../JRE/lib/ext, the package manager _will not_ pick >them up. I can go crazy importing java.util.Hashtable >or javax.util.Timer for example, but cannot import >from com.foo.bar unless foobar.jar is in >../JRE/lib/ext. I need to change this so that I can >load libs from a custom directory. As a workaround you can add the packages to the package cache by doing a sys.add_package("com.foo.bar") from within the python module before doing from com.foo.bar import Baz regards, finn |
From: <bc...@wo...> - 2001-02-16 14:54:05
|
[brian] > Are you using the latest CVS version of jython? Finn has > fixed where the jars and clases under your WEB-INF were > not being found. Since the servlet container does not add > the WEB-INF/* subdirs to the CLASSPATH, jython originally > had no means of getting to those classes. But the patch > added support to have the jython classloader look in optional > directories for jar's and class'es. I have tested this under > JRun with great success and I believe others have used > Tomcat. [Jaroslav Gergic] >Thak you for the tip! I will optionally upgrade - The change that brian describe is in org.python.util.PyServlet. Since you can't possible be using this class (because it is completely new) you will not find any benefits by upgrading. Unless you also begin to use org.python.util.PyServlet. >but >I would prefer to use at least milestone release in my software, >I do not like CVS snapshots a lot. ;) > >Meantime I solved the problem with the Jython 2.0 relase: >Step 1: modify the property in the reistry file (my.lib): >---sample--- >python.packages.paths = my.lib, java.class.path, sun.boot.class.path >python.packages.directories = java.ext.dirs >---END--- That is exactly the trick used by org.python.util.PyServlet. http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/jython/org/python/util/PyServlet.java?rev=1.6&content-type=text/x-cvsweb-markup&cvsroot=jython >Step 2 run JVM with proper settings: >java -cp ... -Dpython.home=<path to reg. file> -Dmy.lib=<path to jar> > >It works and jython finds the classes in your custom JAR file. regards, finn |
From: Jaroslav G. <j_g...@ya...> - 2001-02-16 14:02:27
|
--- brian zimmer <bz...@zi...> wrote: > Are you using the latest CVS version of jython? Finn has > fixed where the jars and clases under your WEB-INF were > not being found. Since the servlet container does not add > the WEB-INF/* subdirs to the CLASSPATH, jython originally > had no means of getting to those classes. But the patch > added support to have the jython classloader look in optional > directories for jar's and class'es. I have tested this under > JRun with great success and I believe others have used > Tomcat. Thak you for the tip! I will optionally upgrade - but I would prefer to use at least milestone release in my software, I do not like CVS snapshots a lot. ;) Meantime I solved the problem with the Jython 2.0 relase: Step 1: modify the property in the reistry file (my.lib): ---sample--- python.packages.paths = my.lib, java.class.path, sun.boot.class.path python.packages.directories = java.ext.dirs ---END--- Step 2 run JVM with proper settings: java -cp ... -Dpython.home=<path to reg. file> -Dmy.lib=<path to jar> It works and jython finds the classes in your custom JAR file. Regards Gergic ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: brian z. <bz...@zi...> - 2001-02-16 13:40:08
|
Are you using the latest CVS version of jython? Finn has fixed where the jars and clases under your WEB-INF were not being found. Since the servlet container does not add the WEB-INF/* subdirs to the CLASSPATH, jython originally had no means of getting to those classes. But the patch added support to have the jython classloader look in optional directories for jar's and class'es. I have tested this under JRun with great success and I believe others have used Tomcat. Again, the latest CVS has these features so you'll have to upgrade or move the jars to another directory already added to the CP by the servlet container. hope this helps, brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Sarwar Raza Sent: Friday, February 16, 2001 6:03 AM To: Jaroslav Gergic; jyt...@li... Subject: Re: [Jython-users] CLASSPATH problem under Tomcat Hi.. I posted a similar problem a few days ago. I have tried adding the application specific jars to my classpath (referring to the jars themselves and not just their directories) but the jpyton interpreter _will not_ pick them up. The only jars cached by the package manager are those in the ..JRE/lib/ext directory. This is a serious problem for me. Any help would be much appreciated. Some additional detail: the jpython modules are run within a jpython interpreter embedded within the application. i.e. there is no CLI. I create a jpython interpreter object and pass it the name of the module to run. If any of these modules contain and 'import from' clause for a package from a jar _not_ contained witin ../JRE/lib/ext, the package manager _will not_ pick them up. I can go crazy importing java.util.Hashtable or javax.util.Timer for example, but cannot import from com.foo.bar unless foobar.jar is in ../JRE/lib/ext. I need to change this so that I can load libs from a custom directory. Thanks -Sarwar --- Jaroslav Gergic <j_g...@ya...> wrote: > Hello all, > I have the following problem with classpaths under > Tomcat: > > Short intro: > all JAR files located in $TOMCAT_HOME/lib are added > to the Java CLASSPATH and are visible to Jython. > NOTE: Their classes are loaded by the system > classloader. > > All JAR files located in an application specific lib > directory + application classes directory are > visible to > a given application. > Application specific classes located in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/classes > Application spec. libraries in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib > NOTE: application specific classes are loader using > org.apache.tomcat.loader.AdaptiveClassLoader12 (!) > > There is only oneway visibility: application classes > can > refer to classes loaded by the system classloader > but NOT vice versa. > > I have my runtime library mylib.jar located in > the application lib directory togehter with the > jython.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/mylib.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/jython.jar > > THE PROBLEM: > jython does not see the classes from mylib.jar, > it only creates cache for the packages found in > the standard Java classpath. (meaning > $TOMCAT_HOME/lib + JRE/lib + ...) > > How to turn jython to inlcude mylib.jar into package > cache and make mylib.jar classes accessible? > > NOTE: I can not move mylib.jar to $TOMCAT_HOME/lib > becaus mylib.jar requires access to application > specific classses. > > Thans for any hint > Gergic > > > > > > ===== > Jaroslav Gergic (Gergi) > mailto:j_g...@ya... > http://nenya.ms.mff.cuni.cz/~gergic/ > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - > only $35 > a year! http://personal.mail.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users ===== ************************* Sarwar S Raza NMS Software Engineer CommWorks Corporation http://www.wpi.edu/~sraza ************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |
From: Jaroslav G. <j_g...@ya...> - 2001-02-16 13:31:47
|
--- Sarwar Raza <raz...@ya...> wrote: > ../JRE/lib/ext. I need to change this so that I can > load libs from a custom directory. You can see following lines in the sample Jython registry: ---sample--- # Properties to check for initializing and updating the package cache # Hopefully you won't have any need to change these python.packages.paths = java.class.path, sun.boot.class.path python.packages.directories = java.ext.dirs ---END sample--- I tried to add my JAR file to the first variable and set python.home JVM property to the directory containing my modified resitry file - the registry file is found by jython but my JAR file is not parsed and cached anyway... Regards Gergic ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Sarwar R. <raz...@ya...> - 2001-02-16 12:02:23
|
Hi.. I posted a similar problem a few days ago. I have tried adding the application specific jars to my classpath (referring to the jars themselves and not just their directories) but the jpyton interpreter _will not_ pick them up. The only jars cached by the package manager are those in the ..JRE/lib/ext directory. This is a serious problem for me. Any help would be much appreciated. Some additional detail: the jpython modules are run within a jpython interpreter embedded within the application. i.e. there is no CLI. I create a jpython interpreter object and pass it the name of the module to run. If any of these modules contain and 'import from' clause for a package from a jar _not_ contained witin ../JRE/lib/ext, the package manager _will not_ pick them up. I can go crazy importing java.util.Hashtable or javax.util.Timer for example, but cannot import from com.foo.bar unless foobar.jar is in ../JRE/lib/ext. I need to change this so that I can load libs from a custom directory. Thanks -Sarwar --- Jaroslav Gergic <j_g...@ya...> wrote: > Hello all, > I have the following problem with classpaths under > Tomcat: > > Short intro: > all JAR files located in $TOMCAT_HOME/lib are added > to the Java CLASSPATH and are visible to Jython. > NOTE: Their classes are loaded by the system > classloader. > > All JAR files located in an application specific lib > directory + application classes directory are > visible to > a given application. > Application specific classes located in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/classes > Application spec. libraries in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib > NOTE: application specific classes are loader using > org.apache.tomcat.loader.AdaptiveClassLoader12 (!) > > There is only oneway visibility: application classes > can > refer to classes loaded by the system classloader > but NOT vice versa. > > I have my runtime library mylib.jar located in > the application lib directory togehter with the > jython.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/mylib.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/jython.jar > > THE PROBLEM: > jython does not see the classes from mylib.jar, > it only creates cache for the packages found in > the standard Java classpath. (meaning > $TOMCAT_HOME/lib + JRE/lib + ...) > > How to turn jython to inlcude mylib.jar into package > cache and make mylib.jar classes accessible? > > NOTE: I can not move mylib.jar to $TOMCAT_HOME/lib > becaus mylib.jar requires access to application > specific classses. > > Thans for any hint > Gergic > > > > > > ===== > Jaroslav Gergic (Gergi) > mailto:j_g...@ya... > http://nenya.ms.mff.cuni.cz/~gergic/ > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - > only $35 > a year! http://personal.mail.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users ===== ************************* Sarwar S Raza NMS Software Engineer CommWorks Corporation http://www.wpi.edu/~sraza ************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |