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: Samuele P. <pe...@in...> - 2001-07-18 16:55:48
|
Note: I moved the discussion to jython-users, at least about this. This is about bound, unbound methods used from java side and a kind of strange interaction with name binding level redefinitions for classes in a PythonInterp. [Joseph Campbell] > Samuele, > Originally you had: > > import org.python.core.*; > import org.python.util.*; > > public class Test { > > public static void main(String[] args) { > PythonInterpreter interp = new PythonInterpreter(); > interp.exec("class A:\n def m(self,a,b):\n print a,b"); > PyClass A =(PyClass)interp.eval("A"); > PyInstance a = (PyInstance)A.__call__(); > PyObject m = A.__findattr__("m"); > > interp.exec("class A:\n def m(self,a,b):\n print b,a"); > PyClass A2 =(PyClass)interp.eval("A"); > PyInstance a2 = (PyInstance)A2.__call__(); > PyObject m2 = A2.__findattr__("m"); > > m2.__call__(a2,new PyInteger(1),new PyInteger(2)); > m.__call__(a,new PyInteger(1),new PyInteger(2)); > > } > } > > Which I agree works just fine... however if you modify to look like the > following: > import org.python.core.*; > import org.python.util.*; > > public class Test { > > public static void main(String[] args) { > PythonInterpreter interp = new PythonInterpreter(); > interp.exec("class A:\n def m(self,a,b):\n print a,b"); > interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); > > PyClass class =(PyClass)interp.eval("B"); for my compiler to accept this, I should change class to clazz. > PyInstance instance = (PyInstance)class.__call__(); > PyObject obj = instance.__findattr__("n"); Differently from me you are retrieving the method from the instance, so you get a bound method. > > // This call works here. > obj.__call__(instance,new PyInteger(1),new PyInteger(2)); This is the wrong way to spell the call to a bound method, no instance needed. See later. > > interp.exec("class A:\n def m(self,a,b):\n print a,b"); > interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); > > // This call doesn't work here. > obj.__call__(instance,new PyInteger(1),new PyInteger(2)); > } > } > > You should get the Trace telling you you have to call the unbound method with > an instance first argument. No, after the class -> clazz change I get: Exception in thread "main" Traceback (innermost last): (no code object) at line 0 TypeError: n() too many arguments; expected 3 got 4 Making perfecly sense, OTOH both these versions work: import org.python.core.*; import org.python.util.*; public class Test { public static void main(String[] args) { PythonInterpreter interp = new PythonInterpreter(); interp.exec("class A:\n def m(self,a,b):\n print a,b"); interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); PyClass clazz =(PyClass)interp.eval("B"); PyInstance instance = (PyInstance)clazz.__call__(); PyObject obj = instance.__findattr__("n"); System.out.println(obj); // This call works here. obj.__call__(new PyInteger(1),new PyInteger(2)); interp.exec("class A:\n def m(self,a,b):\n print a,b"); interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); // This call doesn't work here. obj.__call__(new PyInteger(1),new PyInteger(2)); } } giving: <method B.n of B instance at 5316106> 1 2 1 2 And: import org.python.core.*; import org.python.util.*; public class Test { public static void main(String[] args) { PythonInterpreter interp = new PythonInterpreter(); interp.exec("class A:\n def m(self,a,b):\n print a,b"); interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); PyClass clazz =(PyClass)interp.eval("B"); PyInstance instance = (PyInstance)clazz.__call__(); PyObject obj = clazz.__findattr__("n"); System.out.println(obj); // This call works here. obj.__call__(instance,new PyInteger(1),new PyInteger(2)); interp.exec("class A:\n def m(self,a,b):\n print a,b"); interp.exec("class B(A):\n def n(self,a,b):\n print a,b"); // This call doesn't work here. obj.__call__(instance,new PyInteger(1),new PyInteger(2)); } } giving: <unbound method B.n> 1 2 1 2 The problem you get is more easely triggered through calling a method retrieved from a new class on a old class version instance, or the other way around. Hope this helps. OTOH I still don't see why simply redefining name bindings in the interp namespace can cause the problem you report, methods do not refer to classes by name but through a ref to the class first-class object. I'm still missing an example causing your problem. regards, Samuele Pedroni. |
From: D-Man <ds...@ri...> - 2001-07-18 13:16:17
|
On Wed, Jul 18, 2001 at 10:10:47AM +0000, Mark Robinson wrote: | Hi, | | can anyone tell me how I should convert a Graphics object to a Graphics2D | object in jython.This is what I get: | | Traceback (innermost last): | (no code object) at line 0 | File "drawing.py", line 32 | g2 = (Graphics2D)g | ^ | SyntaxError: invalid syntax Hehe, you're trying to do a C/C++/Java cast in Python :-). Those languages are all statically typed so you must tell the compiler that you really have a Graphics2D object because it can't figure that out for itself. Python, on the other hand, is dynamically typed. Since you know you have a Graphics2D object, just use it! :-). Python/Jython will check to make sure it really is the right object when you call methods on it and it will just work! This is one of the features of Python that make it so easy and fun to use. -D |
From: D-Man <ds...@ri...> - 2001-07-18 13:11:36
|
On Wed, Jul 18, 2001 at 12:03:30PM +0200, Kevin McNamee wrote: | | I have built a jar file from my python scripts | > cd $HOME/work | > jythonc -a -j demo.jar Gui.py | | The GUI uses several gif files stored in 'icons', e.g. | rightIcon = swing.ImageIcon("icons/right.gif") ^^^^^^^^^^^^^^^^^ | | So I add these manually to the demo.jar | > jar -uf demo.jar icons | | I copy demo.jar to it's final location and run it | > cp demo.jar /tmp | > cd /tmp | > java -jar demo.jar | | The GUI starts, but none of the icons appear. If I create the icons | directory locally and copy the icons there, then everything works fine. | > mkdir icons | > cp $HOME/work/icons/* icons | > java -jar demo.jar | | Why is demo.jar looking in ./icons instead of in demo.jar? demo.jar doesn't look anywhere. Your app specifies to look in the filesystem (see highlighted path above). What you want is (in Java) : // you need the 'getResource' method with is found in instances of the // 'Class' class URL path = (new Object()).getClass().getResource( "/icons/right.gif" ) // now make the icon getting the gif from the url ImageIcon = new ImageIcon( path ) If you are doing it from the Jython side use : path = java.lang.Object().getClass().getResource( "/icons/right.gif") icon = javax.swing.ImageIcon( path ) and it should work. Be sure and print the url if it doesn't work so you can see where getResource() thinks that resource is. HTH, -D |
From: Mark R. <blo...@ho...> - 2001-07-18 10:10:55
|
Hi, can anyone tell me how I should convert a Graphics object to a Graphics2D object in jython.This is what I get: Traceback (innermost last): (no code object) at line 0 File "drawing.py", line 32 g2 = (Graphics2D)g ^ SyntaxError: invalid syntax any ideas? blobby _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |
From: Kevin M. <qk...@lm...> - 2001-07-18 10:03:36
|
I have built a jar file from my python scripts > cd $HOME/work > jythonc -a -j demo.jar Gui.py The GUI uses several gif files stored in 'icons', e.g. rightIcon = swing.ImageIcon("icons/right.gif") So I add these manually to the demo.jar > jar -uf demo.jar icons I copy demo.jar to it's final location and run it > cp demo.jar /tmp > cd /tmp > java -jar demo.jar The GUI starts, but none of the icons appear. If I create the icons directory locally and copy the icons there, then everything works fine. > mkdir icons > cp $HOME/work/icons/* icons > java -jar demo.jar Why is demo.jar looking in ./icons instead of in demo.jar? _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: Kevin M. <qk...@lm...> - 2001-07-17 14:23:49
|
Thanks. Works a treat. On Tue, 17 Jul 2001, Jeff Emanuel wrote: > > You need to explicitly extend java.lang.Object. > > from java.lang import Object > class CustomObject(Object): > > > > > _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: Kevin M. <qk...@lm...> - 2001-07-17 08:38:56
|
Thanks for all the help so far. I am trying to use a tree in a splitpane. I am using the Java Swing tutorial on trees as a reference http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html According to this, if I add a custom object to the tree I must implement it's toString method. But it doesn't seem to work: from pawt import swing Node = swing.tree.DefaultMutableTreeNode class CustomObject: def __init__(self, key, value): self.key = key self.value = value def toString(self): print "toString: ", self.key return self.key top=Node("Test") top.add(Node(CustomObject("key","value"))) tree=swing.JTree(top) frame=swing.JFrame() frame.getContentPane().add(tree) frame.visible=1 _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: D-Man <ds...@ri...> - 2001-07-17 03:16:01
|
On Mon, Jul 16, 2001 at 04:23:20PM -0400, Freeze, Deron wrote: | | Trying to execute some python in a Java program I have. This code | uses the win32com module to access a COM component. The interpreter Are you using Microsoft's JVM? I've heard that it supports COM, but I've never looked into it. AFAIK Sun's JVM doesn't support COM because COM is an MS-only technology. Where did you get the win32com package from? If you got it from Mark Hammond or ActiveState then it probably requires CPython because it is a C extension that provides a Python interface to the Windows COM system. The CPython win32all extensions won't work with Jython because Jython is restricted to using only features that are available to Java code. A possible solution would be to use ILU to use the COM stuff in CPython and the Java stuff in Jython or use something like XML-RPC or CORBA to communicate the logic you need to between COM stuff in CPython and Java stuff in Jython. HTH, -D |
From: Freeze, D. <der...@ma...> - 2001-07-16 20:25:20
|
Trying to execute some python in a Java program I have. This code uses the win32com module to access a COM component. The interpreter has no problem finding the win32com module (I set the python.path on the command line when I start the JVM, -dpython.path). When the win32com module is loaded it attempts to load win32api module in another directory, and an exception occurs. Here's a snippet of my code: =========================================================================== public static void main(String []args) throws PyException { PythonInterpreter interp = new PythonInterpreter(); System.out.println("Loading Python modules..."); interp.exec("import sys; print sys.path"); interp.exec("import win32com.client"); interp.exec("x1 = win32com.client.Dispatch(\"MyApp.1\")"); } =========================================================================== output (with error) is: Loading Python modules... ['.', 'C:\\project\\lib\\Lib', 'C:\\python21', 'c:\\python21\\pythonwin', 'c:\ \python21\\win32', 'c:\\python21\\win32\\lib', 'c:\\python21\\dlls', 'c:\\python 21\\lib', 'c:\\python21\\lib\\plat-win', 'c:\\python21\\lib\\lib-tk', 'c:\\pytho n21\\win32comext', 'C:\\Python21\\win32com\\client'] Exception in thread "main" Traceback (innermost last): File "<string>", line 1, in ? File "C:\Python21\win32com\__init__.py", line 5, in ? ImportError: no module named win32api =========================================================================== |
From: Ype K. <yk...@xs...> - 2001-07-16 19:33:23
|
D-, >On Mon, Jul 16, 2001 at 07:37:04PM +0100, Ype Kingma wrote: >| Kevin, >| >| >Is there anyway to find out the type of an object? E.g. >| > >| >>>> a = 1 >| >>>> a.isa(int) >| >1 >| >| Apart from instanceof() (other post) you can also use: > >Heh, too much Java for you too :-). > >'instanceof' is a builtin operator in Java, not Python. <poco a poco piu agitato> Oops :( , I think I have done too much thread scheduling lately: notify(), notifyAll() and wait() have almost the same meaning. This instanceof thing bit me a few times already. Now, who added the colon to the if, while, for, def, class, _and_ try statements? Wasn't that the same guy who designed the Python threads to be "loosely based on Java"? The guy who seems to have said that JPython could not be done? </poco> And all that in _my_ favourite programming language? Ype |
From: D-Man <ds...@ri...> - 2001-07-16 17:36:14
|
On Mon, Jul 16, 2001 at 07:37:04PM +0100, Ype Kingma wrote: | Kevin, | | >Is there anyway to find out the type of an object? E.g. | > | >>>> a = 1 | >>>> a.isa(int) | >1 | | Apart from instanceof() (other post) you can also use: Heh, too much Java for you too :-). 'instanceof' is a builtin operator in Java, not Python. -D |
From: Ype K. <yk...@xs...> - 2001-07-16 17:31:56
|
Kevin, >Is there anyway to find out the type of an object? E.g. > >>>> a = 1 >>>> a.isa(int) >1 Apart from instanceof() (other post) you can also use: type(a) == type(1) Ype |
From: D-Man <ds...@ri...> - 2001-07-16 16:44:06
|
----- Forwarded message from Jeff Emanuel <je...@ad...> ----- From: Jeff Emanuel <je...@ad...> Date: Mon, 16 Jul 2001 10:27:04 -0600 To: D-Man <ds...@ri...> X-Mailer: Mozilla 4.7 [en] (WinNT; U) D-Man wrote: > [ aside : Hey, where'd "isInstance" go? ] Lower case i. isinstance ----- End forwarded message ----- Doh! Too much Java. (Thanks for the correction) Ok, for the benefit of the OP here is a working example :-). >>> import types >>> a = 1 >>> isinstance( a , types.IntType ) 1 >>> class Foo : pass ... >>> b = Foo() >>> isinstance( b , Foo ) 1 >>> class Bar( Foo ) : pass ... >>> c = Bar() >>> isinstance( c , Foo ) 1 -D |
From: D-Man <ds...@ri...> - 2001-07-16 16:19:32
|
On Mon, Jul 16, 2001 at 05:00:19PM +0200, Kevin McNamee wrote: | Is there anyway to find out the type of an object? E.g. | | >>> a = 1 | >>> a.isa(int) | 1 >>> a=1 >>> type( a ) <jclass org.python.core.PyInteger at 6284031> >>> import types >>> print type(a) == types.IntType 1 >>> print a.__class__ org.python.core.PyInteger >>> print isInstance( a , types.IntType ) Traceback (innermost last): File "<console>", line 1, in ? NameError: isInstance >>> [ aside : Hey, where'd "isInstance" go? ] Check out the 'types' module too. That is good for built-in types which, in CPython but not Jython, are different from class instances. The isInstance function is better because it works with classes too. The only problem with it is I don't know what object to pass in as the "class" of the built-in types. (Also it doesn't seem to be a built-in function in Jython) HTH, -D |
From: Kevin M. <qk...@lm...> - 2001-07-16 15:00:31
|
Is there anyway to find out the type of an object? E.g. >>> a = 1 >>> a.isa(int) 1 _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 E-Mail : kev...@er... |
From: Steve Y. <st...@ca...> - 2001-07-14 19:33:37
|
Thanks!! -steve Kevin Butler writes: > Steve Yegge wrote: > > > I've found a case where it doesn't work: > > > > from java.lang import Boolean > > ... > > obj.setProperty("foobar", Boolean.FALSE) > > > > I also tried: > > > > obj.setProperty("foobar", 0) > > > > but that somehow turns 0 into an int value and uses that, > > where I really wanted a boolean. > > > > I didn't see a public answer for this question, so here goes. > > >>> from java.lang import * > >>> from java.util import * > >>> m = HashMap() > >>> m.put( "one", Boolean.FALSE ) > >>> m.put( "two", Boolean( 0 ) ) > >>> m > {two=false, one=0} > >>> > > The problem is that jython converts the Boolean.FALSE to an 'int' for > you to work with in jython (normal attribute access, etc.). To pass in > a Boolean object, you need to explicitly specify it via constructing one > as your parameter. > > >>> Boolean.FALSE > 0 > >>> Boolean( Boolean.FALSE ) > false > >>> > > kb > |
From: Kevin B. <kb...@ca...> - 2001-07-14 14:10:24
|
Steve Yegge wrote: > I've found a case where it doesn't work: > > from java.lang import Boolean > ... > obj.setProperty("foobar", Boolean.FALSE) > > I also tried: > > obj.setProperty("foobar", 0) > > but that somehow turns 0 into an int value and uses that, > where I really wanted a boolean. > I didn't see a public answer for this question, so here goes. >>> from java.lang import * >>> from java.util import * >>> m = HashMap() >>> m.put( "one", Boolean.FALSE ) >>> m.put( "two", Boolean( 0 ) ) >>> m {two=false, one=0} >>> The problem is that jython converts the Boolean.FALSE to an 'int' for you to work with in jython (normal attribute access, etc.). To pass in a Boolean object, you need to explicitly specify it via constructing one as your parameter. >>> Boolean.FALSE 0 >>> Boolean( Boolean.FALSE ) false >>> kb |
From: Daniel L. <da...@br...> - 2001-07-13 15:40:19
|
> How do I apply constraints to a GridBag? > >>>> from pawt import swing, awt, GridBag >>>> >>>> frame = swing.JFrame() >>>> c = awt.GridBagConstraints() >>>> button = swing.JButton() >>>> gridbag = GridBag(frame.contentPane) >>>> gridbag.setConstraints(button,c) > Traceback (innermost last): > File "<console>", line 1, in ? > AttributeError: setConstraints >>>> Generally, replace the key word for the Java accessor methods "get" and "set" with just the field name, e.g. gridBag.setConstraints --> gridBag.constraints I have used GridBagLayout very successfully in Jython. Now custom cell renderers in JTable, well that's a different issue ;-) |
From: D-Man <ds...@ri...> - 2001-07-12 16:48:53
|
On Thu, Jul 12, 2001 at 05:33:29PM +0100, Mark blobby Robinson wrote: | Hi, | | I have just installed jython 2.0 and just wondering if anyone can help | me get rid of a pile of warnings that I get everytime I run the swing | demos i.e simple.py. I am running red hat 6.0 and the warnings are: | | Font specified in font.properties not found | [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] | | other than that, the program seems to run fine, but I'd really | appreciate being able to either change the font specification or add the | required font ever the prog is wanting and not finding, anyone know how? This is swing stuff. I'd just ignore it. I get lots of font warnings when I run swing stuff on a *nix box xhosted by a win box. However, your error message says the font is specified in font.properties. If you could find that file you could change it. Alternatively you could install that font and then it would be found (probably better if you want to have better/more fonts available). -D |
From: Mark b. R. <m.1...@he...> - 2001-07-12 16:33:50
|
Hi, I have just installed jython 2.0 and just wondering if anyone can help me get rid of a pile of warnings that I get everytime I run the swing demos i.e simple.py. I am running red hat 6.0 and the warnings are: Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] other than that, the program seems to run fine, but I'd really appreciate being able to either change the font specification or add the required font ever the prog is wanting and not finding, anyone know how? blobby |
From: Kevin D. <kda...@we...> - 2001-07-12 15:58:30
|
As a followup, here's a bit of code that illustrates: public class MyClass extends SomePyThing { public int sum(int val1, int val2) { return val1 + val2; } } --jython-- import MyClass a = MyClass() a.foo = 2 a.bar = 4 a.sum(a.foo, a.bar) With a standard Java class, a.foo=2 would fail. With a subclass of PyInstance, a.foo = 2 would work, but a.sum(...) would fail (AttributeError, because it can't find the method since reflection isn't used). Kevin ----- Original Message ----- From: "Kevin Dangoor" <kda...@we...> To: <jyt...@li...> Sent: Thursday, July 12, 2001 11:11 AM Subject: [Jython-users] Making a class that acts as both a Python object and a Java object > Jython does a great job emulating Python objects in Java. It also, > through reflection, does a great job of letting you use Java methods, etc. > in Jython. It seems like it would be useful to have a base class that gives > you both sets of behavior out of the box: > > - it would have a __dict__ to store things in > - it would use reflection to find out about Java methods > - it would look like a python class and allow you to use Jython's multiple > inheritance mechanism > > This type of thing would allow you to easily build all sorts of extensions > to Jython. In situations where someone is more comfortable or it is more > convenient to do something in Java, you can still make objects that look > like python objects to Jython programs. > > I'm just coming back to this after a couple of weeks away, but if memory > serves subclassing PyObject doesn't give __dict__ or reflection. Subclassing > PyInstance does give you a functional __dict__, but doesn't do reflection. > Subclassing PyClass actually can give both but PyClasses are not quite the > same. And there are a lot of private and protected members in there which > prevent easy subclassing. > > Has anyone else been interested in such a thing? Any suggestions on an > approach to take? > > Thanks, > Kevin > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users |
From: Kevin D. <kda...@we...> - 2001-07-12 15:12:08
|
Jython does a great job emulating Python objects in Java. It also, through reflection, does a great job of letting you use Java methods, etc. in Jython. It seems like it would be useful to have a base class that gives you both sets of behavior out of the box: - it would have a __dict__ to store things in - it would use reflection to find out about Java methods - it would look like a python class and allow you to use Jython's multiple inheritance mechanism This type of thing would allow you to easily build all sorts of extensions to Jython. In situations where someone is more comfortable or it is more convenient to do something in Java, you can still make objects that look like python objects to Jython programs. I'm just coming back to this after a couple of weeks away, but if memory serves subclassing PyObject doesn't give __dict__ or reflection. Subclassing PyInstance does give you a functional __dict__, but doesn't do reflection. Subclassing PyClass actually can give both but PyClasses are not quite the same. And there are a lot of private and protected members in there which prevent easy subclassing. Has anyone else been interested in such a thing? Any suggestions on an approach to take? Thanks, Kevin |
From: Samuele P. <pe...@in...> - 2001-07-12 15:05:01
|
Hi. > hi, > > i am somehow surprised that this is not possible > > >>JAVA > public void addRow(Dictionary _row) > >>JYTHON > addRow({}) > > but instead prints the following errormsg: > >>TypeError: addRow(): 1st arg can't be coerced to java.util.Dictionary > > where is the problem to convert a org.python.core.PyDictionary > into a java.util.Dictionary or even better into java.util.Map? So just propose a patch <wink>. Some refs and a partial/tentative discussion of potential issues is at: http://www.geocrawler.com/archives/3/7017/2001/6/50/5904682/ regards, Samuele Pedroni. |
From: D-Man <ds...@ri...> - 2001-07-12 14:45:05
|
On Thu, Jul 12, 2001 at 02:13:36PM +0200, Kevin McNamee wrote: | How do I apply constraints to a GridBag? | | >>> from pawt import swing, awt, GridBag | >>> | >>> frame = swing.JFrame() | >>> c = awt.GridBagConstraints() | >>> button = swing.JButton() | >>> gridbag = GridBag(frame.contentPane) | >>> gridbag.setConstraints(button,c) | Traceback (innermost last): | File "<console>", line 1, in ? | AttributeError: setConstraints | >>> >>> dir( gridbag ) ['defaults', 'frame', 'gridbag'] >>> print gridbag.gridbag java.awt.GridBagLayout >>> dir( gridbag.gridbag ) [] >>> dir( gridbag.gridbag.__class__ ) ['__init__', 'addLayoutComponent', 'columnWeights', 'columnWidths', 'getConstraints', 'getLayoutDimensions', 'getLayoutOrigin', 'getLayoutWeights', 'layoutDimensions', 'layoutOrigin', 'layoutWeights', 'location', 'rowHeights', 'rowWeights', 'setConstraints'] >>> gridbag.gridbag.setConstraints(button,c) ^^^^^^^^ I hope the interactive session above gives you a hint how to find these sort of things out, as well as the answer to your question :-). -D |
From: Robert K. <rob...@ya...> - 2001-07-12 14:36:59
|
hi, i am somehow surprised that this is not possible >>JAVA public void addRow(Dictionary _row) >>JYTHON addRow({}) but instead prints the following errormsg: >>TypeError: addRow(): 1st arg can't be coerced to java.util.Dictionary where is the problem to convert a org.python.core.PyDictionary into a java.util.Dictionary or even better into java.util.Map? ciao robertj ===== itemj http://www.itemj.com Robert Kuzelj Gaissacherstrasse 7 81371 Muenchen tel 0177 5302230 __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ |