Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
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
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
|
2
(3) |
3
(2) |
4
(8) |
5
(1) |
6
(2) |
7
(2) |
8
|
9
(12) |
10
(9) |
11
(5) |
12
(5) |
13
(4) |
14
(2) |
15
(3) |
16
(3) |
17
(6) |
18
(16) |
19
(4) |
20
(2) |
21
|
22
(1) |
23
(1) |
24
(1) |
25
(1) |
26
|
27
|
28
|
29
(5) |
30
(1) |
31
(3) |
|
|
|
From: Updike, Clark <Clark.Updike@jh...> - 2003-12-13 20:59:04
|
Am I using this wrong? Jython 2.1 on java1.3.1_01 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import sys >>> try: ... raise Error('oops') ... except: ... exc_tb = sys.exc_info()[2] ... >>> from traceback import extract_stack >>> extract_stack(exc_tb) Traceback (innermost last): File "<console>", line 1, in ? File "C:\apps\jython-2.1\Lib\traceback.py", line 266, in extract_stack AttributeError: instance of 'org.python.core.PyTraceback' has no attribute 'f_lineno' I couldn't find any bugs related to this or discussion in the dev mailing list. traceback.print_stack does the same thing. TIA, Clark |
From: Updike, Clark <Clark.Updike@jh...> - 2003-12-13 17:47:24
|
I'm trying to remember what aspects of jython this compatibility restriction affects--what features could be added if 1.1 compatibility was dropped. I scanned jython source for 1.1 references but only find things that required workarounds or minor performance issues, yet I remember running into a retriction at one point. It may have been related to seemless python collection conversion to java collections (preventing PyList from implementing java.util.List, etc), or or maybe something to do with applets. What added functionality would be possible if the 1.1 compatibility restriction were dropped? TIA, Clark -----Original Message----- From: Samuele Pedroni To: jython-users@... Sent: 12/13/2003 5:25 AM Subject: [Jython-users] Who is still depending on Java 1.1 compatibility? |
From: Samuele Pedroni <pedronis@bl...> - 2003-12-13 10:22:14
|
From: Crapo, Andrew W (Research) <crapo@cr...> - 2003-12-12 21:50:55
|
I'm working on a Jython editor with outline view, etc., in Eclipse. Puzzled about why the text editor window highlighting was not correct for anything with indent level > 0, I finally dived into the Jython code. It appears that a tab size of 8 is hard-coded into the parser, giving node column values in the parse tree which are not compatible with my editors tab size of 4. Can anyone verify? |
From: Paul Crowley <paul@ls...> - 2003-12-12 16:12:41
|
Randolph Brown wrote: > In article <3FC60B18.90803@...>, Paul Crowley <paul@...> wrote: > >>I'm writing a Swing-based application and I want to catch all unhandled >>exceptions and cleanly terminate the application with an error to the >>user. Since the exception handler that currently seems to be invoked to >>handle exceptions I want to catch is the Python one, not the Java one, >>it looks like I should be using sys.excepthook. > > Swing exceptions are difficult to catch in java too. I tried a solution based on sun.awt.exception.handler (by writing part of it in Java), but it didn't get called. This makes sense: the default Swing exception handler, which prints a Java-style stack trace, wasn't being called before I replaced it, so it's not surprising it wasn't called after either. The reason it didn't get called, I think, is because in the transition from Python back to Java as the exception propogated up the call stack, it got caught by Jython's default exception handler. The error I see is certainly a Jython-specific one, not a Java one, including text like "Traceback (innermost last)" which is in org/python/core/PyTraceback.java in the Jython sources. So I still think it's a bug in Jython that it's calling its factory exception handler at this point when I've replaced it. > Perhaps a setting could be added to the jython registry? I don't think this is needed. -- __ Paul Crowley \/ o\ paul@... /\__/ http://www.lshift.net |
From: Laurent <fl@op...> - 2003-12-12 08:11:03
|
Selon Brian O'Halloran <bohalloran@...>: > > How can I convert a Python time object to java.sql.Timestamp? why don't you get time with a java Date object ? >>> from java.util import * >>> Timestamp(Date().getTime()) 2003-12-12 09:07:56.781 If you want to use time python function, you can have >>> (y,m,d,h,min,s,wd,yd,i)=time.localtime(time.time()) >>> Timestamp(y,m,d,h,min,s,0) 3904-01-12 09:10:24.0 >>> but this constructor is deprecated... > > Here's code I'm running w/in jython. > >>> import time > >>> from com.ris.build.model import Build > >>> build = Build.create() > >>> from com.ris.build.model import BuildExtent > >>> buildExtent = BuildExtent() > >>> from java.sql import DriverManager > >>> from java.sql import Driver > >>> driver = Driver.forName("org.postgresql.Driver").newInstance() > >>> connection = > DriverManager.getConnection("jdbc:postgresql://192.168.100.215:5432/ris";, > "ris", "ris") > >>> buildExtent.useConnection(connection) > >>> build.buildId(buildExtent.nextBuildId().value()) > >>> buildStartTime = time.ctime(time.time()) > >>> build.buildEnd(buildStartTime) > Traceback (innermost last): > File "<console>", line 1, in ? > TypeError: buildEnd(): 1st arg can't be coerced to java.sql.Timestamp > Fred -- XPath free testing software : http://lantern.sourceforge.net Frédéric Laurent http://www.opikanoba.org |
From: <liusong1111@ho...> - 2003-12-12 02:08:15
|
thanks for kindness of Jeff Emanuel and Updike, Clark ! when I pasted the code to mail,the indent problem apeared in IE's textarea,but I didn't realize it and just put some spaces to make it look like what i want. so a chance missed. but I still remember the code in Eclipse looks right. today, according to your guide, i rewrite it with careful indenting,everything OK! I should search some articles which introduce how to config eclipse for jython. best regards! robert,a jython beginner. >From: "Updike, Clark" <Clark.Updike@...> >To: "'liusong1111@...'" <liusong1111@...> >Subject: RE: [Jython-users] jython's setattr works strangely >Date: Thu, 11 Dec 2003 09:36:32 -0500 > >It is hard to tell from the indenting of your code, but is there any chance >that your setattr line is not running inside your while loop and only runs >after the while loop is completed? That would explain what you see. > >-Clark > >-----Original Message----- >From: liusong1111@... [mailto:liusong1111@...] >Sent: Thursday, December 11, 2003 2:25 AM >To: jython-users@... >Subject: [Jython-users] jython's setattr works strangely > > >i want to map request's parameters to T instance data member. when i try so, >something gone wrong. > >when visit: http://hostname/path/JServlet.py?a=3&b=4&xxx=555 >the console output: >xxx 555 >b 4 >a 3 >{'a','3'} > >BUT I expect {'xxx':'555','b':'4','a':'3'} > >addition:any plugin for eclipse to support Jython? > >#### code: > >import java, javax, sys > >class T(java.lang.Object): > def __init__(self,request): > self.wrap(request) > > def wrap(self,request): > paramNames = request.getParameterNames() > while(paramNames.hasNext()): > paramName = paramNames.next() > paramValue = request.getParameter(paramName) > print paramName , paramValue > setattr(self,str(paramName),paramValue) > print self.__dict__ > > > >class JServlet(javax.servlet.http.HttpServlet): > > def doGet(self, request, response): > response.setContentType("text/html") > req = T(request) > out = response.getOutputStream() > > print >>out,dir(req) > > > out.close() > return > >_________________________________________________________________ >享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com > > > >------------------------------------------------------- >This SF.net email is sponsored by: IBM Linux Tutorials. >Become an expert in LINUX or just sharpen your skills. Sign up for IBM's >Free Linux Tutorials. Learn everything from the bash shell to sys admin. >Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click >_______________________________________________ >Jython-users mailing list >Jython-users@... >https://lists.sourceforge.net/lists/listinfo/jython-users _________________________________________________________________ 免费下载 MSN Explorer: http://explorer.msn.com/lccn/ |
From: Samuele Pedroni <pedronis@bl...> - 2003-12-12 00:01:03
|
At 20:23 11.12.2003 +0100, Xavier Noria wrote: >How modifiable are classes in Python by code? Can you change the list of >ancestors of a class before any instance is created? yes __bases__ is writable, although if you have a Java class in there you should keep it, this is not checked but should be respected. (In CPython 2.2 etc for new-style classes the rules are a bit more involved) >Can you wrap a method to add pre or post code a la CLOS? Can you redefine >a class at any time as in Ruby? if you mean as in: >>> class A: ... def meth(self): return 1 ... >>> a=A() >>> class A: ... def meth(self): return 2 ... >>> a.meth() 1 no, because the class statement simply and always creates a new class object and binds it to a name. But you can modify the old/original version of the class: >>> class A: ... def meth(self): return 1 ... >>> a=A() >>> a.meth() 1 >>> def meth(self): return 2 ... >>> A.meth = meth >>> a.meth() 2 You can also add "methods" to instances: ... >>> def meth2(): # no self, really just a function to live in instance namespace ... return 'a' ... >>> a.meth2=meth2 >>> a.meth2() 'a' or ... >>> import new >>> def meth2(self): ... return self.meth()*2 ... >>> a.meth2=new.instancemethod(meth2,a,a.__class__) >>> a.meth2() 4 >>> |
From: Brian O'Halloran <bohalloran@re...> - 2003-12-11 22:06:50
|
How can I convert a Python time object to java.sql.Timestamp? Here's code I'm running w/in jython. >>> import time >>> from com.ris.build.model import Build >>> build = Build.create() >>> from com.ris.build.model import BuildExtent >>> buildExtent = BuildExtent() >>> from java.sql import DriverManager >>> from java.sql import Driver >>> driver = Driver.forName("org.postgresql.Driver").newInstance() >>> connection = DriverManager.getConnection("jdbc:postgresql://192.168.100.215:5432/ris";, "ris", "ris") >>> buildExtent.useConnection(connection) >>> build.buildId(buildExtent.nextBuildId().value()) >>> buildStartTime = time.ctime(time.time()) >>> build.buildEnd(buildStartTime) Traceback (innermost last): File "<console>", line 1, in ? TypeError: buildEnd(): 1st arg can't be coerced to java.sql.Timestamp Ideas? Brian O'Halloran |
From: Xavier Noria <fxn@is...> - 2003-12-11 19:23:38
|
El 11/12/2003, a las 16:27, Jeff Emanuel escribi=F3: > Can your classes extend a common superclass. The constructor > of the superclass can to the registration. This is the approach we are towering at somehow, thank you. We chose an scripting language as Python for several reasons, one of=20 them being its flexibility and the existence of exec() to modify or=20 create source code on the fly if we need it. The objective is to offer an IDE where you don't work in a normal=20 decoupled object oriented environment, as if you developed using a=20 library. We have to find a balance between offering common things=20 solved out the box and without the needed of code, and programming on=20 the model-builder side. In this particular case, we want to be able to take advantage of the=20 dynamism of Python to, for instance, let the user associate a widget to=20= a class through a wizard and have the display of all its instances=20 happen magically in simulation time. I ask for your advice because unfortunately no one in the team is=20 fluent in Python, so it's difficult to be creative and offer powerful=20 features. How modifiable are classes in Python by code? Can you change the list=20 of ancestors of a class before any instance is created? Can you wrap a=20= method to add pre or post code a la CLOS? Can you redefine a class at=20 any time as in Ruby? Is there some online reference where we can have a=20= general picture of what can be modified of class/method definitions=20 dynamically? -- fxn |
From: Xavier Noria <fxn@is...> - 2003-12-11 09:07:08
|
We are pondering whether it would be possible to monitor somehow the creation and destruction of objects of a certain type. In explicit code those objects would register/deregister themselves to some observer calling some method, but we would like to do that somehow automatically. The context is an IDE to develop simple agent-based models that provides facilities to display the running agents in different ways. We would like to let the developer associate some graphical widget to some class (written in Jython by him with the tool) and have at simulation time all instances of that class painted in the widget by some object written by us with enough visibility. All approaches would be welcomed, decorators, modification of class definitions on the fly, forgetting altogether this feauture... Any suggestions? -- fxn |
From: Pieter Claerhout <Pieter.Claerhout@Creo.com> - 2003-12-11 09:03:27
|
I'm having some problems with using a compiled Jython class which is contained in JAR file. This is what I did. First of all, I created the following class: class MySampleClass: def __init__( self, name ): self.name = name def printName( self ): print self.name I compiled that class to a JAR file using the following command: jythonc --package "be.yellowduck" --jar "..\MySampleJar.jar" *.py I put the jar file in a higher directory level to make sure it was not accidently using the .py file instead. Then I opened a shell, added the JAR file to the classpath, and started Jython. The session looked pretty much as follows: C:\Documents and Settings\PClaerho\Desktop>jython *sys-package-mgr*: processing new jar, 'C:\Documents and Settings\PClaerho\Desktop\MySampleJar.jar' Jython 2.1 on java1.4.2_02 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from be.yellowduck import MySampleClass >>> myCls = MySampleClass( 'pieter' ) Traceback (innermost last): File "<console>", line 1, in ? TypeError: be.yellowduck.MySampleClass(): expected 0 args; got 1 It looks like it's finding the class, but I cannot seem to use it. Is this supposed to work? If so, what am I doing wrong? pieter |
From: <liusong1111@ho...> - 2003-12-11 07:25:12
|
i want to map request's parameters to T instance data member. when i try so,something gone wrong. when visit: http://hostname/path/JServlet.py?a=3&b=4&xxx=555 the console output: xxx 555 b 4 a 3 {'a','3'} BUT I expect {'xxx':'555','b':'4','a':'3'} addition:any plugin for eclipse to support Jython? #### code: import java, javax, sys class T(java.lang.Object): def __init__(self,request): self.wrap(request) def wrap(self,request): paramNames = request.getParameterNames() while(paramNames.hasNext()): paramName = paramNames.next() paramValue = request.getParameter(paramName) print paramName , paramValue setattr(self,str(paramName),paramValue) print self.__dict__ class JServlet(javax.servlet.http.HttpServlet): def doGet(self, request, response): response.setContentType("text/html") req = T(request) out = response.getOutputStream() print >>out,dir(req) out.close() return _________________________________________________________________ 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com |
From: Jeff Emanuel <JEmanuel@lg...> - 2003-12-10 18:58:03
|
See "Calling Methods in Your Superclass" at http://www.jython.org/docs/subclassing.html from java.awt import Canvas, AWTEvent class MyCanvas(Canvas): def __init__(self): mask=AWTEvent.MOUSE_MOTION_EVENT_MASK|AWTEvent.MOUSE_EVENT_MASK self.super__enableEvents(mask) -----Original Message----- From: sgouran@... [mailto:sgouran@...] Sent: Wednesday, December 10, 2003 10:52 AM To: jython-users@... Subject: [Jython-users] Jython Newbie Need Help with AWT Hi, if in Jython I subclass the Canvas class, and then want to call a protected method from the Component class how would I go about it. Specific to my problem, in java I would do the following in the constructor: this.enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK) How would I go about it in Jython? Everything I have tried has given me attribute errors 1 ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Jython-users mailing list Jython-users@... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Jeff Emanuel <JEmanuel@lg...> - 2003-12-10 18:46:51
|
enableEvents=Component.getDeclaredMethod("enableEvents",[java.lang.Long.TYPE ]) enableEvents.accessible=1 enableEvents.invoke( -----Original Message----- From: sgouran@... [mailto:sgouran@...] Sent: Wednesday, December 10, 2003 10:52 AM To: jython-users@... Subject: [Jython-users] Jython Newbie Need Help with AWT Hi, if in Jython I subclass the Canvas class, and then want to call a protected method from the Component class how would I go about it. Specific to my problem, in java I would do the following in the constructor: this.enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK) How would I go about it in Jython? Everything I have tried has given me attribute errors 1 ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Jython-users mailing list Jython-users@... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <sgouran@ro...> - 2003-12-10 17:52:50
|
Hi, if in Jython I subclass the Canvas class, and then want to call a protected method from the Component class how would I go about it. Specific to my problem, in java I would do the following in the constructor: this.enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK) How would I go about it in Jython? Everything I have tried has given me attribute errors 1 |
From: Jeff Emanuel <JEmanuel@lg...> - 2003-12-10 15:48:55
|
If you want information from a java instance, you need pass the instance's class to dir like this: dir(foo.class) But this won't tell you about the superclass's methods or interface methods. You can find those either like this: dir(foo.class.superclass) dir(foo.class.interfaces[0]) etc. Or you can use Java reflection more directly: for method in foo.class.methods: print method.name -----Original Message----- From: Adam Hupp [mailto:hupp@...] Sent: Wednesday, December 10, 2003 8:29 AM To: Jeff Emanuel Cc: jython-users@... Subject: Re: [Jython-users] Where is dict and sum, and enumerating methods On Tue, Dec 09, 2003 at 05:15:31PM -0600, Jeff Emanuel wrote: > > I don't know about the the missing parts, but > dir(someJavaClass) is already useful: > > >>> import java > >>> dir(java.lang.String) > ['CASE_INSENSITIVE_ORDER', 'bytes', 'compareTo', 'compareToIgnoreCase', > 'concat' > , 'contentEquals', 'copyValueOf', 'endsWith', 'equalsIgnoreCase', > 'getBytes', 'g > etChars', 'indexOf', 'intern', 'lastIndexOf', 'matches', 'regionMatches', > 'repla > ce', 'replaceAll', 'replaceFirst', 'split', 'startsWith', 'substring', > 'toCharAr > ray', 'toLowerCase', 'toUpperCase', 'trim', 'valueOf'] Ah, I didn't check that. I should have specified that I was talking about class instances though. For instance, dir("foo") on CPython gives all of the available string methods, but just an empty list in jython (CVS). Strangely enough, dir({}) does give the dict methods in jython. -Adam |
From: Adam Hupp <hupp@cs...> - 2003-12-10 15:29:01
|
On Tue, Dec 09, 2003 at 05:15:31PM -0600, Jeff Emanuel wrote: > > I don't know about the the missing parts, but > dir(someJavaClass) is already useful: > > >>> import java > >>> dir(java.lang.String) > ['CASE_INSENSITIVE_ORDER', 'bytes', 'compareTo', 'compareToIgnoreCase', > 'concat' > , 'contentEquals', 'copyValueOf', 'endsWith', 'equalsIgnoreCase', > 'getBytes', 'g > etChars', 'indexOf', 'intern', 'lastIndexOf', 'matches', 'regionMatches', > 'repla > ce', 'replaceAll', 'replaceFirst', 'split', 'startsWith', 'substring', > 'toCharAr > ray', 'toLowerCase', 'toUpperCase', 'trim', 'valueOf'] Ah, I didn't check that. I should have specified that I was talking about class instances though. For instance, dir("foo") on CPython gives all of the available string methods, but just an empty list in jython (CVS). Strangely enough, dir({}) does give the dict methods in jython. -Adam |
From: Adam Hupp <hupp@cs...> - 2003-12-10 15:25:44
|
On Wed, Dec 10, 2003 at 12:13:57AM +0100, Samuele Pedroni wrote: > > there was no dict in CPython 2.1. I should have been more specific. I've checked 2.1, 2.2a0, and CVS. -Adam |
From: Oti <ohumbel@ya...> - 2003-12-10 13:49:44
|
[ Luciano Ramalho ] > I'm developing a few simple Jython servlets under Tomcat as examples > for a demonstration. > > They all run fine on my local machine (MacOSX), but when I deploy > them > to a Debian server, I get "ImportError: no module named java" when > trying to run those that use java.* modules. > > However, the ones that only import javax.servlet and Python modules > run > fine. > > # ----------------------------------------- BROKEN: > # ----------------- ImportError: no module named java > # ----------------------------------------- > import javax.servlet.http as http > from java.util import Date > from java.text import SimpleDateFormat > import sys Maybe this helps: import sys sys.add_package("java.util") sys.add_package("java.text") from java.util import Date from java.text import SimpleDateFormat Best wishes, Oti. |
From: Samuele Pedroni <pedronis@bl...> - 2003-12-10 01:12:16
|
At 20:27 05.12.2003 -0500, Satya Ghattu wrote: >I even tried the sys.excepthook, but that didn't work. Here's what i did. > >def Myexcepthook(type, value, tb): > print "in Myexcepthook" > import traceback > lines=traceback.format_exception(type, value, tb) > print "---------------------Traceback lines-----------------------" > print "\n".join(lines) > print "-----------------------------------------------------------" >sys.excepthook=Myexcepthook > >foo() > > >>> execfile("xx.py") >foo is called >I am logging u and throwing a exception ... >Traceback (innermost last): > File "<input>", line 1, in ? > File "xx.py", line 10, in ? > File "<iostream>", line 374, in yo >java.lang.Exception: exception thrown > at scriptContext.myClass.foo(myClass.java:837) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java) > at org.python.core.PyMethod.__call__(PyMethod.java) > at org.python.core.PyObject.__call__(PyObject.java) > at org.python.core.PyObject.invoke(PyObject.java) > at org.python.pycode._pyx0.yo$50(<iostream>:374) > at org.python.pycode._pyx0.call_function(<iostream>) > at org.python.core.PyTableCode.call(PyTableCode.java) > at org.python.core.PyTableCode.call(PyTableCode.java) > at org.python.core.PyFunction.__call__(PyFunction.java) > at org.python.pycode._pyx8.f$0(xx.py:10) > at org.python.pycode._pyx8.call_function(xx.py) > at org.python.core.PyTableCode.call(PyTableCode.java) > at org.python.core.PyCode.call(PyCode.java) > at org.python.core.Py.runCode(Py.java) > at org.python.core.__builtin__.execfile_flags(__builtin__.java) > at org.python.core.__builtin__.execfile(__builtin__.java) > at org.python.core.__builtin__.execfile(__builtin__.java) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java) > at > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java) > at org.python.core.PyObject.__call__(PyObject.java) > at org.python.pycode._pyx7.f$0(<input>:1) > at org.python.pycode._pyx7.call_function(<input>) > at org.python.core.PyTableCode.call(PyTableCode.java) > at org.python.core.PyCode.call(PyCode.java) > at org.python.core.Py.runCode(Py.java) > at org.python.core.Py.exec(Py.java) > at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) > at > org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java) > at > org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java) > at > org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java) > at scriptContext.myClass.main(myClass.java:152) > >java.lang.Exception: java.lang.Exception: exception thrown > >>> yes, this is supposed to work, in the CVS it is fixed here: http://cvs.sourceforge.net/viewcvs.py/jython/jython/org/python/util/InteractiveInterpreter.java?r1=2.8&r2=2.9 if you are using your own InteractiveIntepreter you can do the same. regards. |
From: Luciano Ramalho <luciano@hi...> - 2003-12-10 00:55:47
|
I'm developing a few simple Jython servlets under Tomcat as examples for a demonstration. They all run fine on my local machine (MacOSX), but when I deploy them to a Debian server, I get "ImportError: no module named java" when trying to run those that use java.* modules. However, the ones that only import javax.servlet and Python modules run fine. Here are two short examples: # ----------------------------------------- RUNS OK import javax.servlet.http as http from time import time, localtime, strftime import sys class hora_py(http.HttpServlet): def doGet(self, request, response): sys.stdout = response.outputStream response.contentType = 'text/html' hms = strftime('%H:%M:%S',localtime(time())) print '<center><h1>%s</h1></center>' % hms # ----------------------------------------- BROKEN: # ----------------- ImportError: no module named java # ----------------------------------------- import javax.servlet.http as http from java.util import Date from java.text import SimpleDateFormat import sys class hora(http.HttpServlet): def doGet(self, request, response): out = response.outputStream response.contentType = 'text/html' fmt = SimpleDateFormat('HH:mm:ss.SSS') hms = fmt.format(Date()) print >> out, '<center><h1>%s</h1></center>' % hms # ----------------------------------------- Any hints? Best regards, Luciano Ramalho |
From: Jeff Emanuel <JEmanuel@lg...> - 2003-12-09 23:16:15
|
I don't know about the the missing parts, but dir(someJavaClass) is already useful: >>> import java >>> dir(java.lang.String) ['CASE_INSENSITIVE_ORDER', 'bytes', 'compareTo', 'compareToIgnoreCase', 'concat' , 'contentEquals', 'copyValueOf', 'endsWith', 'equalsIgnoreCase', 'getBytes', 'g etChars', 'indexOf', 'intern', 'lastIndexOf', 'matches', 'regionMatches', 'repla ce', 'replaceAll', 'replaceFirst', 'split', 'startsWith', 'substring', 'toCharAr ray', 'toLowerCase', 'toUpperCase', 'trim', 'valueOf'] -----Original Message----- From: Adam Hupp [mailto:hupp@...] Sent: Tuesday, December 09, 2003 4:02 PM To: jython-users@... Subject: [Jython-users] Where is dict and sum, and enumerating methods I just started using jython and I'm finding it very useful. I've noticed that some things are different. Where is dict()? list(), str(), etc are in __builtins__, but not dict. I can mimic CPython by doing import org.python.core.PyDictionary import __builtin__ __builtin__.dict = org.python.core.PyDictionary But that shouldn't be necessary. I also noticed sum is missing from __builtin__. Another thing I would like is for dir(someJavaClass) to return something useful. Is there any plans to do this? It would be nice to have. -Adam ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Jython-users mailing list Jython-users@... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Samuele Pedroni <pedronis@bl...> - 2003-12-09 23:11:27
|
At 17:02 09.12.2003 -0600, Adam Hupp wrote: >I just started using jython and I'm finding it very useful. I've >noticed that some things are different. > >Where is dict()? list(), str(), etc are in __builtins__, but not >dict. I can mimic CPython by doing > >import org.python.core.PyDictionary >import __builtin__ >__builtin__.dict = org.python.core.PyDictionary > >But that shouldn't be necessary. I also noticed sum is missing from >__builtin__. > >Another thing I would like is for dir(someJavaClass) to return >something useful. Is there any plans to do this? It would be nice to >have. there was no dict in CPython 2.1. |
From: Adam Hupp <hupp@cs...> - 2003-12-09 23:02:10
|
I just started using jython and I'm finding it very useful. I've noticed that some things are different. Where is dict()? list(), str(), etc are in __builtins__, but not dict. I can mimic CPython by doing import org.python.core.PyDictionary import __builtin__ __builtin__.dict = org.python.core.PyDictionary But that shouldn't be necessary. I also noticed sum is missing from __builtin__. Another thing I would like is for dir(someJavaClass) to return something useful. Is there any plans to do this? It would be nice to have. -Adam |