You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pj...@us...> - 2009-05-12 02:22:27
|
Revision: 6344 http://jython.svn.sourceforge.net/jython/?rev=6344&view=rev Author: pjenvey Date: 2009-05-12 01:51:08 +0000 (Tue, 12 May 2009) Log Message: ----------- quiet some warnings and small cleanup Modified Paths: -------------- trunk/jython/src/org/python/modules/itertools.java trunk/jython/src/org/python/util/JLineConsole.java trunk/jython/tests/java/javatests/Dict2JavaTest.java Modified: trunk/jython/src/org/python/modules/itertools.java =================================================================== --- trunk/jython/src/org/python/modules/itertools.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/src/org/python/modules/itertools.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,3 +1,4 @@ +/* Copyright (c) Jython Developers */ package org.python.modules; import java.util.ArrayList; @@ -134,7 +135,7 @@ // start over again counter = 0; } - return (PyObject)saved.get(counter++); + return saved.get(counter++); } }; Modified: trunk/jython/src/org/python/util/JLineConsole.java =================================================================== --- trunk/jython/src/org/python/util/JLineConsole.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/src/org/python/util/JLineConsole.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,3 +1,4 @@ +/* Copyright (c) Jython Developers */ package org.python.util; import java.io.File; @@ -87,6 +88,7 @@ return getClass().getResourceAsStream("jline-keybindings.properties"); } + @Override public String raw_input(PyObject prompt) { String line = null; try { Modified: trunk/jython/tests/java/javatests/Dict2JavaTest.java =================================================================== --- trunk/jython/tests/java/javatests/Dict2JavaTest.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/tests/java/javatests/Dict2JavaTest.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,9 +1,10 @@ +/* Copyright (c) Jython Developers */ package javatests; + import java.util.Map; import java.util.Set; import java.util.Collection; import java.util.HashMap; -import java.util.Iterator; /** * This class is used by the test_dict2java.py test script for testing @@ -13,21 +14,21 @@ */ public class Dict2JavaTest { - private Map map = null; + private Map<Object, Object> map; - public Dict2JavaTest(Map map) { + public Dict2JavaTest(Map<Object, Object> map) { this.map = map; } - - public Set entrySet() { + + public Set<Map.Entry<Object, Object>> entrySet() { return map.entrySet(); } - public Set keySet() { + public Set<Object> keySet() { return map.keySet(); } - public Collection values() { + public Collection<Object> values() { return map.values(); } @@ -41,7 +42,7 @@ } public boolean test_putAll_efg() { - HashMap hmap = new HashMap(); + HashMap<String, String> hmap = new HashMap<String, String>(); hmap.put("e", "1"); hmap.put("f", null); hmap.put("g", "2"); @@ -70,21 +71,21 @@ public boolean test_java_mapentry() { // created outside of Jython with non PyOjects - HashMap hmap = new HashMap(); + HashMap<String, Object> hmap = new HashMap<String, Object>(); hmap.put("b", "y"); - Map.Entry entry = (Map.Entry)hmap.entrySet().iterator().next(); + Map.Entry<String, Object> entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; // Test a number - hmap = new HashMap(); + hmap = new HashMap<String, Object>(); hmap.put("i", new Integer(3)); - entry = (Map.Entry)hmap.entrySet().iterator().next(); + entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; // test Null - hmap = new HashMap(); + hmap = new HashMap<String, Object>(); hmap.put("f", null); - entry = (Map.Entry)hmap.entrySet().iterator().next(); + entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; return true; } @@ -92,7 +93,7 @@ // make sure nulls are handled and other object types, nulls // should never match anything in the entry set. public boolean test_entry_set_nulls() { - Set set = map.entrySet(); + Set<Map.Entry<Object, Object>> set = map.entrySet(); return set.contains(null) == false && set.remove(null) == false && set.contains(new Boolean(true)) == false && set.remove(new String("")) == false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-12 02:22:21
|
Revision: 6343 http://jython.svn.sourceforge.net/jython/?rev=6343&view=rev Author: pjenvey Date: 2009-05-12 01:35:11 +0000 (Tue, 12 May 2009) Log Message: ----------- this metatype check will never happen Modified Paths: -------------- trunk/jython/src/org/python/core/PyType.java Modified: trunk/jython/src/org/python/core/PyType.java =================================================================== --- trunk/jython/src/org/python/core/PyType.java 2009-05-11 21:04:36 UTC (rev 6342) +++ trunk/jython/src/org/python/core/PyType.java 2009-05-12 01:35:11 UTC (rev 6343) @@ -151,7 +151,7 @@ } PyType type; - if (new_.for_type == metatype || metatype == PyType.fromClass(Class.class)) { + if (new_.for_type == metatype) { // XXX: set metatype type = new PyType(); } else { @@ -437,7 +437,7 @@ type_prepended[0] = type; newobj = new_.__get__(null, type).__call__(type_prepended, keywords); } - /* special case type(x) */ + // special case type(x) if (type == TYPE && args.length == 1 && keywords.length == 0) { return newobj; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 21:04:44
|
Revision: 6342 http://jython.svn.sourceforge.net/jython/?rev=6342&view=rev Author: fwierzbicki Date: 2009-05-11 21:04:36 +0000 (Mon, 11 May 2009) Log Message: ----------- rc2 already. Added Paths: ----------- tags/Release_2_5rc2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 21:03:32
|
Revision: 6341 http://jython.svn.sourceforge.net/jython/?rev=6341&view=rev Author: fwierzbicki Date: 2009-05-11 21:03:27 +0000 (Mon, 11 May 2009) Log Message: ----------- Changes for rc2. Modified Paths: -------------- trunk/jython/README.txt trunk/jython/build.xml Modified: trunk/jython/README.txt =================================================================== --- trunk/jython/README.txt 2009-05-11 21:00:49 UTC (rev 6340) +++ trunk/jython/README.txt 2009-05-11 21:03:27 UTC (rev 6341) @@ -1,12 +1,15 @@ -Welcome to Jython 2.5rc1 +Welcome to Jython 2.5rc2 ======================== -This is the first release candidate of the 2.5 version of Jython. It contains -bug fixes and polish since the last beta. One especially nice bit of polish is -that jline is enabled by default now, and so using up and down arrows should -work out of the box. If no major bugs are found this release will get -re-labled and released as the production version of 2.5.0. +This is the second release candidate of the 2.5 version of Jython (about 10 +minutes after the first). It fixes a windows bug with our jline support on +windows. Below is the RC1 notes: +It contains bug fixes and polish since the last beta. One especially nice bit +of polish is that jline is enabled by default now, and so using up and down +arrows should work out of the box. If no major bugs are found this release +will get re-labled and released as the production version of 2.5.0. + The release was compiled on Mac OS X with JDK 5 and requires JDK 5 to run. Please try this out and report any bugs at http://bugs.jython.org. Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-11 21:00:49 UTC (rev 6340) +++ trunk/jython/build.xml 2009-05-11 21:03:27 UTC (rev 6341) @@ -186,13 +186,13 @@ <property name="PY_RELEASE_LEVEL_SNAPSHOT" value="170"/> <!-- 0xAA --> <!-- The current version info --> - <property name="jython.version" value="2.5rc1+"/> - <property name="jython.version.noplus" value="2.5rc1"/> + <property name="jython.version" value="2.5rc2+"/> + <property name="jython.version.noplus" value="2.5rc2"/> <property name="jython.major_version" value="2"/> <property name="jython.minor_version" value="5"/> <property name="jython.micro_version" value="0"/> <property name="jython.release_level" value="${PY_RELEASE_LEVEL_GAMMA}"/> - <property name="jython.release_serial" value="1"/> + <property name="jython.release_serial" value="2"/> <condition property="do.snapshot.build"> <isset property="snapshot.revision" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 21:00:55
|
Revision: 6340 http://jython.svn.sourceforge.net/jython/?rev=6340&view=rev Author: fwierzbicki Date: 2009-05-11 21:00:49 +0000 (Mon, 11 May 2009) Log Message: ----------- Drop name mangle of jline for now since it breaks windows. Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-11 16:14:06 UTC (rev 6339) +++ trunk/jython/build.xml 2009-05-11 21:00:49 UTC (rev 6340) @@ -563,7 +563,9 @@ <rule pattern="org.apache.wml.**" result="org.python.apache.wml.@1"/> <rule pattern="org.apache.html.**" result="org.python.apache.html.@1"/> <zipfileset src="extlibs/jline-0.9.95-SNAPSHOT.jar"/> + <!-- <rule pattern="jline.**" result="org.python.jline.@1"/> + --> <manifest> <attribute name="Main-Class" value="org.python.util.jython" /> <attribute name="Built-By" value="${user.name}" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 16:14:15
|
Revision: 6339 http://jython.svn.sourceforge.net/jython/?rev=6339&view=rev Author: fwierzbicki Date: 2009-05-11 16:14:06 +0000 (Mon, 11 May 2009) Log Message: ----------- tagging rc1! Added Paths: ----------- tags/Release_2_5rc1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 15:27:01
|
Revision: 6338 http://jython.svn.sourceforge.net/jython/?rev=6338&view=rev Author: fwierzbicki Date: 2009-05-11 15:26:58 +0000 (Mon, 11 May 2009) Log Message: ----------- Increment release numbers, update NEWS and README. Modified Paths: -------------- trunk/jython/NEWS trunk/jython/README.txt trunk/jython/build.xml Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-05-11 14:45:39 UTC (rev 6337) +++ trunk/jython/NEWS 2009-05-11 15:26:58 UTC (rev 6338) @@ -1,6 +1,6 @@ Jython NEWS -Jython 2.5.0 rc 1 +Jython 2.5.0 a0 - rc1 Bugs fixed (new numbering due to move to Roundup) - [ 1188 ] Patch against trunk to handle SecurityExceptions - [ 1271 ] Bean property accessors in derived class overide methods in base class @@ -9,9 +9,6 @@ - [ 1272 ] ASTList ClassCastException - [ 1261 ] jython -c "import sys; sys.exit(1)" not giving correct exit code. - [ 1215 ] extra spaces in import statement break importing - -Jython 2.5.0 a0 - b3 - Bugs fixed (new numbering due to move to Roundup) - [ 1126 ] ImportError raised for Java subpackages import - [ 1111 ] keyword arguments not supported on __import__ - [ 1567212 ] Jython $py.class bytecode doesn't include the .py's mtime Modified: trunk/jython/README.txt =================================================================== --- trunk/jython/README.txt 2009-05-11 14:45:39 UTC (rev 6337) +++ trunk/jython/README.txt 2009-05-11 15:26:58 UTC (rev 6338) @@ -1,15 +1,12 @@ -Welcome to Jython 2.5b4 -======================= +Welcome to Jython 2.5rc1 +======================== -This is the fifth beta of the 2.5 version of Jython. It contains a new -implementation of List and Tuple, as well as a patch which helps Jython run in -an envrironment without file write access (specifically for use on Google App -Engine) There are also a number of smaller bug fixes. This beta contains all -of the new features for the eventual 2.5 release continues the feature freeze. -We are very close, once this beta has been tested in the wild for a bit and we -close a few more high priority bugs, we will start release candidates. +This is the first release candidate of the 2.5 version of Jython. It contains +bug fixes and polish since the last beta. One especially nice bit of polish is +that jline is enabled by default now, and so using up and down arrows should +work out of the box. If no major bugs are found this release will get +re-labled and released as the production version of 2.5.0. The release was compiled on Mac OS X with JDK 5 and requires JDK 5 to run. -As a beta release, this release is incomplete and contains bugs. Do not -use in a production environment. +Please try this out and report any bugs at http://bugs.jython.org. Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-11 14:45:39 UTC (rev 6337) +++ trunk/jython/build.xml 2009-05-11 15:26:58 UTC (rev 6338) @@ -186,13 +186,13 @@ <property name="PY_RELEASE_LEVEL_SNAPSHOT" value="170"/> <!-- 0xAA --> <!-- The current version info --> - <property name="jython.version" value="2.5b4+"/> - <property name="jython.version.noplus" value="2.5b4"/> + <property name="jython.version" value="2.5rc1+"/> + <property name="jython.version.noplus" value="2.5rc1"/> <property name="jython.major_version" value="2"/> <property name="jython.minor_version" value="5"/> <property name="jython.micro_version" value="0"/> - <property name="jython.release_level" value="${PY_RELEASE_LEVEL_BETA}"/> - <property name="jython.release_serial" value="4"/> + <property name="jython.release_level" value="${PY_RELEASE_LEVEL_GAMMA}"/> + <property name="jython.release_serial" value="1"/> <condition property="do.snapshot.build"> <isset property="snapshot.revision" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-05-11 14:45:49
|
Revision: 6337 http://jython.svn.sourceforge.net/jython/?rev=6337&view=rev Author: fwierzbicki Date: 2009-05-11 14:45:39 +0000 (Mon, 11 May 2009) Log Message: ----------- We shouldn't be distributing jdbc jars, even in the installer. Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-11 03:48:59 UTC (rev 6336) +++ trunk/jython/build.xml 2009-05-11 14:45:39 UTC (rev 6337) @@ -655,9 +655,16 @@ <include name="Lib/jxxload_help/*.java" /> <include name="src/org/**/ucnhash.dat" /> <include name="grammar/*.g" /> - <include name="extlibs/**/*.jar" /> <include name="tests/java/**/*.java" /> <include name="CoreExposed.includes" /> + <include name="extlibs/**/*.jar" /> + + <!-- don't distribute jdbc jars --> + <exclude name="extlibs/mysql-connector-java-5.1.6.jar" /> + <exclude name="extlibs/postgresql-8.3-603.jdbc4.jar" /> + <exclude name="extlibs/ifxjdbc.jar" /> + <exclude name="extlibs/ojdbc14.jar" /> + </fileset> </copy> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-05-11 03:49:09
|
Revision: 6336 http://jython.svn.sourceforge.net/jython/?rev=6336&view=rev Author: zyasoft Date: 2009-05-11 03:48:59 +0000 (Mon, 11 May 2009) Log Message: ----------- More findbugs fixes: removed inconsistent synchronization for cPickle.PickleMemo (should be thread confined anyway). Modified Paths: -------------- trunk/jython/src/org/python/modules/_marshal.java trunk/jython/src/org/python/modules/cPickle.java Modified: trunk/jython/src/org/python/modules/_marshal.java =================================================================== --- trunk/jython/src/org/python/modules/_marshal.java 2009-05-11 02:39:06 UTC (rev 6335) +++ trunk/jython/src/org/python/modules/_marshal.java 2009-05-11 03:48:59 UTC (rev 6336) @@ -416,8 +416,7 @@ int size = read_int(); String s = read_string(size); if (type == TYPE_INTERNED) { - s.intern(); // do we really honor like this? - PyString pys = PyString.fromInterned(s); + PyString pys = PyString.fromInterned(s.intern()); strings.append(pys); return pys; } else { Modified: trunk/jython/src/org/python/modules/cPickle.java =================================================================== --- trunk/jython/src/org/python/modules/cPickle.java 2009-05-11 02:39:06 UTC (rev 6335) +++ trunk/jython/src/org/python/modules/cPickle.java 2009-05-11 03:48:59 UTC (rev 6336) @@ -1426,7 +1426,7 @@ /* * A very specialized and simplified version of PyStringMap. It can * only use integers as keys and stores both an integer and an object - * as value. It is very private! + * as value. It is very private! And should only be used thread-confined. */ static private class PickleMemo { //Table of primes to cycle through @@ -1456,7 +1456,7 @@ this(4); } - public synchronized int size() { + public int size() { return size; } @@ -1521,7 +1521,7 @@ } - private synchronized final void resize(int capacity) { + private final void resize(int capacity) { int p = prime; for(; p<primes.length; p++) { if (primes[p] >= capacity) break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-05-11 02:39:20
|
Revision: 6335 http://jython.svn.sourceforge.net/jython/?rev=6335&view=rev Author: zyasoft Date: 2009-05-11 02:39:06 +0000 (Mon, 11 May 2009) Log Message: ----------- Applied fixes to problems found by findbugs. Modified Paths: -------------- trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/PyBytecode.java trunk/jython/src/org/python/core/PyInstance.java trunk/jython/src/org/python/core/PyJavaType.java trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/org/python/core/PyUnicode.java trunk/jython/src/org/python/core/packagecache/CachedJarsPackageManager.java trunk/jython/src/org/python/core/packagecache/PathPackageManager.java trunk/jython/src/org/python/modules/cStringIO.java trunk/jython/src/org/python/modules/time/Time.java trunk/jython/src/org/python/util/jython.java Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/Py.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -490,15 +490,15 @@ /* Helper functions for PyProxy's */ /* Convenience methods to create new constants without using "new" */ - private static PyInteger[] integerCache = null; + private final static PyInteger[] integerCache = new PyInteger[1000]; + static { + for (int j = -100; j < 900; j++) { + integerCache[j + 100] = new PyInteger(j); + } + } + public static final PyInteger newInteger(int i) { - if (integerCache == null) { - integerCache = new PyInteger[1000]; - for (int j = -100; j < 900; j++) { - integerCache[j + 100] = new PyInteger(j); - } - } if (i >= -100 && i < 900) { return integerCache[i + 100]; } else { @@ -1442,8 +1442,15 @@ throw Py.TypeError("None required for void return"); } } - private static PyString[] letters = null; + + private final static PyString[] letters = new PyString[256]; + static { + for (char j = 0; j < 256; j++) { + letters[j] = new PyString(new Character(j).toString()); + } + } + public static final PyString makeCharacter(Character o) { return makeCharacter(o.charValue()); } @@ -1461,13 +1468,6 @@ } else if (codepoint > 256) { return new PyString((char)codepoint); } - - if (letters == null) { - letters = new PyString[256]; - for (char j = 0; j < 256; j++) { - letters[j] = new PyString(new Character(j).toString()); - } - } return letters[codepoint]; } Modified: trunk/jython/src/org/python/core/PyBytecode.java =================================================================== --- trunk/jython/src/org/python/core/PyBytecode.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/PyBytecode.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -175,7 +175,7 @@ }; // to enable why's to be stored on a PyStack - private class PyStackWhy extends PyObject { + private static class PyStackWhy extends PyObject { Why why; @@ -189,7 +189,7 @@ } } - private class PyStackException extends PyObject { + private static class PyStackException extends PyObject { PyException exception; @@ -1361,7 +1361,7 @@ // XXX - perhaps add support for max stack size (presumably from co_stacksize) // and capacity hints - private class PyStack { + private static class PyStack { final List<PyObject> stack; @@ -1479,7 +1479,7 @@ } } - private class PyTryBlock extends PyObject { // purely to sit on top of the existing PyFrame in f_exits!!! + private static class PyTryBlock extends PyObject { // purely to sit on top of the existing PyFrame in f_exits!!! int b_type; /* what kind of block this is */ Modified: trunk/jython/src/org/python/core/PyInstance.java =================================================================== --- trunk/jython/src/org/python/core/PyInstance.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/PyInstance.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -123,7 +123,7 @@ if (args.length != 0) { init = instclass.lookup("__init__"); if (init != null) { - ret = init.__call__(this, args, keywords); + init.__call__(this, args, keywords); } else { throw Py.TypeError("this constructor takes no arguments"); } Modified: trunk/jython/src/org/python/core/PyJavaType.java =================================================================== --- trunk/jython/src/org/python/core/PyJavaType.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/PyJavaType.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -890,9 +890,6 @@ @Override public void setSlice(int start, int stop, int step, PyObject value) { - if (stop < start) { - stop = start; - } if (step == 0) { return; } Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -13,6 +13,7 @@ import java.nio.charset.UnsupportedCharsetException; import java.security.AccessControlException; import java.util.Map; +import java.util.Map.Entry; import java.util.Properties; import java.util.StringTokenizer; import java.util.jar.JarEntry; @@ -650,9 +651,10 @@ FileInputStream fp = new FileInputStream(file); try { fileProperties.load(fp); - for (Object key : fileProperties.keySet()) { + for (Entry kv : fileProperties.entrySet()) { + Object key = kv.getKey(); if (!registry.containsKey(key)) { - registry.put(key, fileProperties.get(key)); + registry.put(key, kv.getValue()); } } } finally { Modified: trunk/jython/src/org/python/core/PyUnicode.java =================================================================== --- trunk/jython/src/org/python/core/PyUnicode.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/PyUnicode.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -365,7 +365,7 @@ } } - private class SteppedIterator<T> implements Iterator { + private static class SteppedIterator<T> implements Iterator { private final Iterator<T> iter; private final int step; @@ -526,7 +526,7 @@ return new PyUnicode(buffer); } - private class StripIterator implements Iterator { + private static class StripIterator implements Iterator { private final Iterator<Integer> iter; private int lookahead = -1; @@ -715,7 +715,7 @@ } } - private class PeekIterator<T> implements Iterator { + private static class PeekIterator<T> implements Iterator { private T lookahead = null; private final Iterator<T> iter; @@ -744,7 +744,7 @@ } } - private class ReversedIterator<T> implements Iterator { + private static class ReversedIterator<T> implements Iterator { private final List<T> reversed = Generic.list(); private final Iterator<T> iter; Modified: trunk/jython/src/org/python/core/packagecache/CachedJarsPackageManager.java =================================================================== --- trunk/jython/src/org/python/core/packagecache/CachedJarsPackageManager.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/packagecache/CachedJarsPackageManager.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -167,13 +167,13 @@ // Turn each vector into a comma-separated String Map<String, String> transformed = Generic.map(); - for (String key : zipPackages.keySet()) { - List<String>[] vec = zipPackages.get(key); + for (Entry<String,List<String>[]> kv : zipPackages.entrySet()) { + List<String>[] vec = kv.getValue(); String classes = listToString(vec[0]); if (vec[1].size() > 0) { classes += '@' + listToString(vec[1]); } - transformed.put(key, classes); + transformed.put(kv.getKey(), classes); } return transformed; @@ -344,6 +344,7 @@ // Read in cache file storing package info for a single .jar // Return null and delete this cachefile if it is invalid + @SuppressWarnings("empty-statement") private Map<String, String> readCacheFile(JarXEntry entry, String jarcanon) { String cachefile = entry.cachefile; long mtime = entry.mtime; @@ -388,9 +389,9 @@ ostream.writeLong(entry.mtime); comment("rewriting cachefile for '" + jarcanon + "'"); - for (String packageName : zipPackages.keySet()) { - String classes = zipPackages.get(packageName); - ostream.writeUTF(packageName); + for (Entry<String,String> kv : zipPackages.entrySet()) { + String classes = kv.getValue(); + ostream.writeUTF(kv.getKey()); ostream.writeUTF(classes); } ostream.close(); Modified: trunk/jython/src/org/python/core/packagecache/PathPackageManager.java =================================================================== --- trunk/jython/src/org/python/core/packagecache/PathPackageManager.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/core/packagecache/PathPackageManager.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -64,7 +64,7 @@ return false; } - class PackageExistsFileFilter implements FilenameFilter { + private static class PackageExistsFileFilter implements FilenameFilter { private boolean java; private boolean python; Modified: trunk/jython/src/org/python/modules/cStringIO.java =================================================================== --- trunk/jython/src/org/python/modules/cStringIO.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/modules/cStringIO.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -33,7 +33,7 @@ // would be nicer if we directly imported from os, but crazy to do so // since in python code itself - private class os { + private static class os { public static final int SEEK_SET = 0; public static final int SEEK_CUR = 1; public static final int SEEK_END = 2; Modified: trunk/jython/src/org/python/modules/time/Time.java =================================================================== --- trunk/jython/src/org/python/modules/time/Time.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/modules/time/Time.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -344,40 +344,40 @@ "Nov", "Dec"}; - private static String _shortday(int dow) { + private synchronized static String _shortday(int dow) { // we need to hand craft shortdays[] because Java and Python have // different specifications. Java (undocumented) appears to be // first element "", followed by 0=Sun. Python says 0=Mon - try { - if (shortdays == null) { - shortdays = new String[7]; - String[] names = datesyms.getShortWeekdays(); - for (int i=0; i<6; i++) - shortdays[i] = names[i+2]; - shortdays[6] = names[1]; + if (shortdays == null) { + shortdays = new String[7]; + String[] names = datesyms.getShortWeekdays(); + for (int i = 0; i < 6; i++) { + shortdays[i] = names[i + 2]; } + shortdays[6] = names[1]; } - catch (ArrayIndexOutOfBoundsException e) { - throwValueError("day of week out of range (0-6)"); + try { + return shortdays[dow]; + } catch (ArrayIndexOutOfBoundsException e) { + throw new PyException(Py.ValueError, new PyString("day of week out of range (0-6)")); } - return shortdays[dow]; } - private static String _shortmonth(int month0to11) { + private synchronized static String _shortmonth(int month0to11) { // getShortWeekdays() returns a 13 element array with the last item // being the empty string. This is also undocumented ;-/ - try { - if (shortmonths == null) { - shortmonths = new String[12]; - String[] names = datesyms.getShortMonths(); - for (int i=0; i<12; i++) - shortmonths[i] = names[i]; + if (shortmonths == null) { + shortmonths = new String[12]; + String[] names = datesyms.getShortMonths(); + for (int i = 0; i < 12; i++) { + shortmonths[i] = names[i]; } } - catch (ArrayIndexOutOfBoundsException e) { - throwValueError("month out of range (1-12)"); + try { + return shortmonths[month0to11]; + } catch (ArrayIndexOutOfBoundsException e) { + throw new PyException(Py.ValueError, new PyString("month out of range (1-12)")); } - return shortmonths[month0to11]; } private static String _padint(int i, int target) { Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2009-05-11 00:49:23 UTC (rev 6334) +++ trunk/jython/src/org/python/util/jython.java 2009-05-11 02:39:06 UTC (rev 6335) @@ -220,12 +220,16 @@ } catch (FileNotFoundException e) { throw Py.IOError(e); } - if (FileUtil.isatty(file.getFD())) { - opts.interactive = true; - interp.interact(null, new PyFile(file)); - System.exit(0); - } else { - interp.execfile(file, opts.filename); + try { + if (FileUtil.isatty(file.getFD())) { + opts.interactive = true; + interp.interact(null, new PyFile(file)); + System.exit(0); + } else { + interp.execfile(file, opts.filename); + } + } finally { + file.close(); } } catch (Throwable t) { if (t instanceof PyException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-11 00:49:39
|
Revision: 6334 http://jython.svn.sourceforge.net/jython/?rev=6334&view=rev Author: pjenvey Date: 2009-05-11 00:49:23 +0000 (Mon, 11 May 2009) Log Message: ----------- quiet some warnings Modified Paths: -------------- trunk/jython/src/org/python/core/PyString.java trunk/jython/src/org/python/core/exceptions.java trunk/jython/src/org/python/modules/itertools.java trunk/jython/src/org/python/modules/random/PyRandom.java trunk/jython/src/org/python/modules/sre/PatternObject.java trunk/jython/src/org/python/modules/sre/SRE_STATE.java Modified: trunk/jython/src/org/python/core/PyString.java =================================================================== --- trunk/jython/src/org/python/core/PyString.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/core/PyString.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -590,7 +590,7 @@ return StringUtil.toBytes(string); } - public Object __tojava__(Class c) { + public Object __tojava__(Class<?> c) { if (c.isAssignableFrom(String.class)) { return string; } Modified: trunk/jython/src/org/python/core/exceptions.java =================================================================== --- trunk/jython/src/org/python/core/exceptions.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/core/exceptions.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -634,11 +634,12 @@ return bindStaticJavaMethod(name, exceptions.class, methodName); } - public static PyObject bindStaticJavaMethod(String name, Class cls, String methodName) { + public static PyObject bindStaticJavaMethod(String name, Class<?> cls, String methodName) { Method javaMethod; try { - javaMethod = cls.getMethod(methodName, new Class[] {PyObject.class, PyObject[].class, - String[].class}); + javaMethod = cls.getMethod(methodName, + new Class<?>[] {PyObject.class, PyObject[].class, + String[].class}); } catch (Exception e) { throw Py.JavaError(e); } Modified: trunk/jython/src/org/python/modules/itertools.java =================================================================== --- trunk/jython/src/org/python/modules/itertools.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/modules/itertools.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -109,15 +109,14 @@ */ public static PyIterator cycle(final PyObject sequence) { return new ItertoolsIterator() { - List saved = new ArrayList(); + List<PyObject> saved = new ArrayList<PyObject>(); int counter = 0; PyObject iter = sequence.__iter__(); boolean save = true; public PyObject __iternext__() { - - if(save) { + if (save) { PyObject obj = nextElement(iter); if (obj != null) { saved.add(obj); @@ -126,16 +125,16 @@ save = false; } } - if(saved.size() == 0) { + if (saved.size() == 0) { return null; } // pick element from saved List - if(counter >= saved.size()) { + if (counter >= saved.size()) { // start over again counter = 0; } - return (PyObject) saved.get(counter++); + return (PyObject)saved.get(counter++); } }; Modified: trunk/jython/src/org/python/modules/random/PyRandom.java =================================================================== --- trunk/jython/src/org/python/modules/random/PyRandom.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/modules/random/PyRandom.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -48,7 +48,7 @@ if (seed instanceof PyLong) { PyLong max = new PyLong(Long.MAX_VALUE); PyLong seed_modulus = (PyLong)(seed.__mod__(max)); - this.javaRandom.setSeed(((PyLong)seed_modulus).asLong(0)); + this.javaRandom.setSeed(seed_modulus.asLong(0)); } else if (seed instanceof PyInteger) { this.javaRandom.setSeed(((PyInteger)seed).getValue()); } else { Modified: trunk/jython/src/org/python/modules/sre/PatternObject.java =================================================================== --- trunk/jython/src/org/python/modules/sre/PatternObject.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/modules/sre/PatternObject.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -246,7 +246,7 @@ SRE_STATE state = new SRE_STATE(string, start, end, flags); - final List list = new ArrayList(); + final List<PyObject> list = new ArrayList<PyObject>(); while (state.start <= state.end) { state.state_reset(); Modified: trunk/jython/src/org/python/modules/sre/SRE_STATE.java =================================================================== --- trunk/jython/src/org/python/modules/sre/SRE_STATE.java 2009-05-11 00:48:39 UTC (rev 6333) +++ trunk/jython/src/org/python/modules/sre/SRE_STATE.java 2009-05-11 00:49:23 UTC (rev 6334) @@ -365,14 +365,14 @@ boolean ok = true; for (;;) { - switch ((int)set[setidx++]) { + switch (set[setidx++]) { case SRE_OP_FAILURE: TRACE(setidx, ch, "CHARSET FAILURE"); return !ok; case SRE_OP_LITERAL: - TRACE(setidx, ch, "CHARSET LITERAL " + (int) set[setidx]); + TRACE(setidx, ch, "CHARSET LITERAL " + set[setidx]); /* <LITERAL> <code> */ if (ch == set[setidx]) return ok; @@ -381,8 +381,8 @@ case SRE_OP_CATEGORY: /* <CATEGORY> <code> */ - TRACE(setidx, ch, "CHARSET CHARSET " + (int) set[setidx]); - if (sre_category((int)set[setidx], ch)) + TRACE(setidx, ch, "CHARSET CHARSET " + set[setidx]); + if (sre_category(set[setidx], ch)) return ok; setidx++; break; @@ -403,7 +403,7 @@ case SRE_OP_RANGE: /* <RANGE> <lower> <upper> */ - TRACE(setidx, ch, "CHARSET RANGE " + (int) set[setidx] + " " + (int) set[setidx+1]); + TRACE(setidx, ch, "CHARSET RANGE " + set[setidx] + " " + set[setidx+1]); if (set[setidx] <= ch && ch <= set[setidx+1]) return ok; setidx += 2; @@ -494,7 +494,7 @@ case SRE_OP_LITERAL_IGNORE: /* repeated literal */ chr = pattern[pidx+1]; - TRACE(pidx, ptr, "COUNT LITERAL_IGNORE " + (int) chr); + TRACE(pidx, ptr, "COUNT LITERAL_IGNORE " + chr); while (ptr < end && lower(str[ptr]) == chr) ptr++; break; @@ -502,7 +502,7 @@ case SRE_OP_NOT_LITERAL: /* repeated non-literal */ chr = pattern[pidx+1]; - TRACE(pidx, ptr, "COUNT NOT_LITERAL " + (int) chr); + TRACE(pidx, ptr, "COUNT NOT_LITERAL " + chr); while (ptr < end && str[ptr] != chr) ptr++; break; @@ -510,7 +510,7 @@ case SRE_OP_NOT_LITERAL_IGNORE: /* repeated non-literal */ chr = pattern[pidx+1]; - TRACE(pidx, ptr, "COUNT NOT_LITERAL_IGNORE " + (int) chr); + TRACE(pidx, ptr, "COUNT NOT_LITERAL_IGNORE " + chr); while (ptr < end && lower(str[ptr]) != chr) ptr++; break; @@ -564,8 +564,8 @@ case SRE_OP_MARK: /* set mark */ /* <MARK> <gid> */ - TRACE(pidx, ptr, "MARK " + (int) pattern[pidx]); - i = (int)pattern[pidx]; + TRACE(pidx, ptr, "MARK " + pattern[pidx]); + i = pattern[pidx]; if ((i & 1) != 0) this.lastindex = i / 2 + 1; if (i > this.lastmark) @@ -577,7 +577,7 @@ case SRE_OP_LITERAL: /* match literal character */ /* <LITERAL> <code> */ - TRACE(pidx, ptr, "LITERAL " + (int) pattern[pidx]); + TRACE(pidx, ptr, "LITERAL " + pattern[pidx]); if (ptr >= end || str[ptr] != pattern[pidx]) return 0; @@ -588,7 +588,7 @@ case SRE_OP_NOT_LITERAL: /* match anything that is not literal character */ /* args: <code> */ - TRACE(pidx, ptr, "NOT_LITERAL " + (int) pattern[pidx]); + TRACE(pidx, ptr, "NOT_LITERAL " + pattern[pidx]); if (ptr >= end || str[ptr] == pattern[pidx]) return 0; pidx++; @@ -604,8 +604,8 @@ case SRE_OP_AT: /* match at given position */ /* <AT> <code> */ - TRACE(pidx, ptr, "AT " + (int) pattern[pidx]); - if (!SRE_AT(ptr, (int)pattern[pidx])) + TRACE(pidx, ptr, "AT " + pattern[pidx]); + if (!SRE_AT(ptr, pattern[pidx])) return 0; pidx++; break; @@ -613,9 +613,9 @@ case SRE_OP_CATEGORY: /* match at given category */ /* <CATEGORY> <code> */ - TRACE(pidx, ptr, "CATEGORY " + (int)pattern[pidx]); + TRACE(pidx, ptr, "CATEGORY " + pattern[pidx]); - if (ptr >= end || !sre_category((int)pattern[pidx], str[ptr])) + if (ptr >= end || !sre_category(pattern[pidx], str[ptr])) return 0; pidx++; @@ -650,7 +650,7 @@ break; case SRE_OP_LITERAL_IGNORE: - TRACE(pidx, ptr, "LITERAL_IGNORE " + (int) pattern[pidx]); + TRACE(pidx, ptr, "LITERAL_IGNORE " + pattern[pidx]); if (ptr >= end || lower(str[ptr]) != lower(pattern[pidx])) return 0; pidx++; @@ -658,7 +658,7 @@ break; case SRE_OP_NOT_LITERAL_IGNORE: - TRACE(pidx, ptr, "NOT_LITERAL_IGNORE " + (int) pattern[pidx]); + TRACE(pidx, ptr, "NOT_LITERAL_IGNORE " + pattern[pidx]); if (ptr >= end || lower(str[ptr]) == lower(pattern[pidx])) return 0; pidx++; @@ -679,7 +679,7 @@ case SRE_OP_INFO: /* jump forward */ /* <JUMP> <offset> */ - TRACE(pidx, ptr, "JUMP " + (int) pattern[pidx]); + TRACE(pidx, ptr, "JUMP " + pattern[pidx]); pidx += pattern[pidx]; break; @@ -724,7 +724,7 @@ int mincount = pattern[pidx+1]; - TRACE(pidx, ptr, "REPEAT_ONE " + mincount + " " + (int)pattern[pidx+2]); + TRACE(pidx, ptr, "REPEAT_ONE " + mincount + " " + pattern[pidx+2]); if (ptr + mincount > end) return 0; /* cannot match */ @@ -860,7 +860,7 @@ by the UNTIL operator (MAX_UNTIL, MIN_UNTIL) */ /* <REPEAT> <skip> <1=min> <2=max> item <UNTIL> tail */ - TRACE(pidx, ptr, "REPEAT " + (int)pattern[pidx+1] + " " + (int)pattern[pidx+2]); + TRACE(pidx, ptr, "REPEAT " + pattern[pidx+1] + " " + pattern[pidx+2]); SRE_REPEAT rep = new SRE_REPEAT(repeat); rep.count = -1; @@ -1033,7 +1033,7 @@ case SRE_OP_ASSERT: /* assert subpattern */ /* args: <skip> <back> <pattern> */ - TRACE(pidx, ptr, "ASSERT " + (int) pattern[pidx+1]); + TRACE(pidx, ptr, "ASSERT " + pattern[pidx+1]); this.ptr = ptr - pattern[pidx + 1]; if (this.ptr < this.beginning) @@ -1047,7 +1047,7 @@ case SRE_OP_ASSERT_NOT: /* assert not subpattern */ /* args: <skip> <pattern> */ - TRACE(pidx, ptr, "ASSERT_NOT " + (int) pattern[pidx]); + TRACE(pidx, ptr, "ASSERT_NOT " + pattern[pidx]); this.ptr = ptr - pattern[pidx + 1]; if (this.ptr >= this.beginning) { i = SRE_MATCH(pattern, pidx + 2, level + 1); @@ -1065,7 +1065,7 @@ return 0; default: - TRACE(pidx, ptr, "UNKNOWN " + (int) pattern[pidx-1]); + TRACE(pidx, ptr, "UNKNOWN " + pattern[pidx-1]); return SRE_ERROR_ILLEGAL; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-11 00:48:55
|
Revision: 6333 http://jython.svn.sourceforge.net/jython/?rev=6333&view=rev Author: pjenvey Date: 2009-05-11 00:48:39 +0000 (Mon, 11 May 2009) Log Message: ----------- coding standards/cleanup Modified Paths: -------------- trunk/jython/src/org/python/core/PyBuiltinMethodSet.java Modified: trunk/jython/src/org/python/core/PyBuiltinMethodSet.java =================================================================== --- trunk/jython/src/org/python/core/PyBuiltinMethodSet.java 2009-05-10 21:44:46 UTC (rev 6332) +++ trunk/jython/src/org/python/core/PyBuiltinMethodSet.java 2009-05-11 00:48:39 UTC (rev 6333) @@ -1,54 +1,55 @@ +/* Copyright (c) Jython Developers */ package org.python.core; -public class PyBuiltinMethodSet extends PyBuiltinFunctionSet implements - Cloneable { +public class PyBuiltinMethodSet extends PyBuiltinFunctionSet implements Cloneable { - public PyBuiltinMethodSet(String name, - int index, - int minargs, - int maxargs, - String doc, - Class type) { + private Class<?> type; + + protected PyObject __self__ = Py.None; + + public PyBuiltinMethodSet(String name, int index, int minargs, int maxargs, String doc, + Class<?> type) { super(name, index, minargs, maxargs, doc); this.type = type; } + @Override public PyObject __get__(PyObject obj, PyObject type) { - if(obj != null) { - if(this.type.isAssignableFrom(obj.getClass())) { + if (obj != null) { + if (this.type.isAssignableFrom(obj.getClass())) { return bind(obj); } else { - throw Py.TypeError("descriptor '" + info.getName() + "' for '" + PyType.fromClass(this.type) - + "' objects doesn't apply to '" + obj.getType() + "' object"); + throw Py.TypeError(String.format("descriptor '%s' for '%s' objects doesn't apply " + + "to '%s' object", info.getName(), + PyType.fromClass(this.type), obj.getType())); } } return this; } + @Override public PyBuiltinCallable bind(PyObject bindTo) { - if(__self__ == Py.None) { - PyBuiltinMethodSet bindable; - try { - bindable = (PyBuiltinMethodSet)clone(); - } catch(CloneNotSupportedException e) { - throw new RuntimeException("Didn't expect PyBuiltinMethodSet to throw CloneNotSupported since it implements Cloneable", - e); - } - bindable.__self__ = bindTo; - return bindable; + if (__self__ != Py.None) { + return this; } - return this; + PyBuiltinMethodSet bindable; + try { + bindable = (PyBuiltinMethodSet)clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException("Didn't expect PyBuiltinMethodSet to throw " + + "CloneNotSupported since it implements Cloneable", e); + } + bindable.__self__ = bindTo; + return bindable; } + @Override public PyObject getSelf() { return __self__; } - - public String toString(){ - return "<built-in method "+info.getName()+">"; + + @Override + public String toString() { + return String.format("<built-in method %s>", info.getName()); } - - private Class type; - - protected PyObject __self__ = Py.None; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 21:44:50
|
Revision: 6332 http://jython.svn.sourceforge.net/jython/?rev=6332&view=rev Author: pjenvey Date: 2009-05-10 21:44:46 +0000 (Sun, 10 May 2009) Log Message: ----------- remove redundant cast Modified Paths: -------------- trunk/jython/src/org/python/antlr/ast/AssertDerived.java trunk/jython/src/org/python/antlr/ast/AssignDerived.java trunk/jython/src/org/python/antlr/ast/AttributeDerived.java trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java trunk/jython/src/org/python/antlr/ast/BinOpDerived.java trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java trunk/jython/src/org/python/antlr/ast/BreakDerived.java trunk/jython/src/org/python/antlr/ast/CallDerived.java trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java trunk/jython/src/org/python/antlr/ast/CompareDerived.java trunk/jython/src/org/python/antlr/ast/ContinueDerived.java trunk/jython/src/org/python/antlr/ast/DeleteDerived.java trunk/jython/src/org/python/antlr/ast/DictDerived.java trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java trunk/jython/src/org/python/antlr/ast/ExecDerived.java trunk/jython/src/org/python/antlr/ast/ExprDerived.java trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java trunk/jython/src/org/python/antlr/ast/ForDerived.java trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java trunk/jython/src/org/python/antlr/ast/GlobalDerived.java trunk/jython/src/org/python/antlr/ast/IfDerived.java trunk/jython/src/org/python/antlr/ast/IfExpDerived.java trunk/jython/src/org/python/antlr/ast/ImportDerived.java trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java trunk/jython/src/org/python/antlr/ast/IndexDerived.java trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java trunk/jython/src/org/python/antlr/ast/LambdaDerived.java trunk/jython/src/org/python/antlr/ast/ListCompDerived.java trunk/jython/src/org/python/antlr/ast/ListDerived.java trunk/jython/src/org/python/antlr/ast/ModuleDerived.java trunk/jython/src/org/python/antlr/ast/NameDerived.java trunk/jython/src/org/python/antlr/ast/NumDerived.java trunk/jython/src/org/python/antlr/ast/PassDerived.java trunk/jython/src/org/python/antlr/ast/PrintDerived.java trunk/jython/src/org/python/antlr/ast/RaiseDerived.java trunk/jython/src/org/python/antlr/ast/ReprDerived.java trunk/jython/src/org/python/antlr/ast/ReturnDerived.java trunk/jython/src/org/python/antlr/ast/SliceDerived.java trunk/jython/src/org/python/antlr/ast/StrDerived.java trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java trunk/jython/src/org/python/antlr/ast/SuiteDerived.java trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java trunk/jython/src/org/python/antlr/ast/TupleDerived.java trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java trunk/jython/src/org/python/antlr/ast/WhileDerived.java trunk/jython/src/org/python/antlr/ast/WithDerived.java trunk/jython/src/org/python/antlr/ast/YieldDerived.java trunk/jython/src/org/python/antlr/ast/aliasDerived.java trunk/jython/src/org/python/antlr/ast/argumentsDerived.java trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java trunk/jython/src/org/python/antlr/ast/keywordDerived.java trunk/jython/src/org/python/antlr/op/AddDerived.java trunk/jython/src/org/python/antlr/op/AndDerived.java trunk/jython/src/org/python/antlr/op/AugLoadDerived.java trunk/jython/src/org/python/antlr/op/AugStoreDerived.java trunk/jython/src/org/python/antlr/op/BitAndDerived.java trunk/jython/src/org/python/antlr/op/BitOrDerived.java trunk/jython/src/org/python/antlr/op/BitXorDerived.java trunk/jython/src/org/python/antlr/op/DelDerived.java trunk/jython/src/org/python/antlr/op/DivDerived.java trunk/jython/src/org/python/antlr/op/EqDerived.java trunk/jython/src/org/python/antlr/op/FloorDivDerived.java trunk/jython/src/org/python/antlr/op/GtDerived.java trunk/jython/src/org/python/antlr/op/GtEDerived.java trunk/jython/src/org/python/antlr/op/InDerived.java trunk/jython/src/org/python/antlr/op/InvertDerived.java trunk/jython/src/org/python/antlr/op/IsDerived.java trunk/jython/src/org/python/antlr/op/IsNotDerived.java trunk/jython/src/org/python/antlr/op/LShiftDerived.java trunk/jython/src/org/python/antlr/op/LoadDerived.java trunk/jython/src/org/python/antlr/op/LtDerived.java trunk/jython/src/org/python/antlr/op/LtEDerived.java trunk/jython/src/org/python/antlr/op/ModDerived.java trunk/jython/src/org/python/antlr/op/MultDerived.java trunk/jython/src/org/python/antlr/op/NotDerived.java trunk/jython/src/org/python/antlr/op/NotEqDerived.java trunk/jython/src/org/python/antlr/op/NotInDerived.java trunk/jython/src/org/python/antlr/op/OrDerived.java trunk/jython/src/org/python/antlr/op/ParamDerived.java trunk/jython/src/org/python/antlr/op/PowDerived.java trunk/jython/src/org/python/antlr/op/RShiftDerived.java trunk/jython/src/org/python/antlr/op/StoreDerived.java trunk/jython/src/org/python/antlr/op/SubDerived.java trunk/jython/src/org/python/antlr/op/UAddDerived.java trunk/jython/src/org/python/antlr/op/USubDerived.java trunk/jython/src/org/python/core/ClasspathPyImporterDerived.java trunk/jython/src/org/python/core/PyArrayDerived.java trunk/jython/src/org/python/core/PyBaseExceptionDerived.java trunk/jython/src/org/python/core/PyBooleanDerived.java trunk/jython/src/org/python/core/PyClassMethodDerived.java trunk/jython/src/org/python/core/PyComplexDerived.java trunk/jython/src/org/python/core/PyDictionaryDerived.java trunk/jython/src/org/python/core/PyEnumerateDerived.java trunk/jython/src/org/python/core/PyFileDerived.java trunk/jython/src/org/python/core/PyFloatDerived.java trunk/jython/src/org/python/core/PyFrozenSetDerived.java trunk/jython/src/org/python/core/PyIntegerDerived.java trunk/jython/src/org/python/core/PyListDerived.java trunk/jython/src/org/python/core/PyLongDerived.java trunk/jython/src/org/python/core/PyModuleDerived.java trunk/jython/src/org/python/core/PyObjectDerived.java trunk/jython/src/org/python/core/PyPropertyDerived.java trunk/jython/src/org/python/core/PySetDerived.java trunk/jython/src/org/python/core/PySliceDerived.java trunk/jython/src/org/python/core/PyStringDerived.java trunk/jython/src/org/python/core/PySuperDerived.java trunk/jython/src/org/python/core/PyTupleDerived.java trunk/jython/src/org/python/core/PyTypeDerived.java trunk/jython/src/org/python/core/PyUnicodeDerived.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java trunk/jython/src/org/python/modules/random/PyRandomDerived.java trunk/jython/src/org/python/modules/thread/PyLocalDerived.java trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java trunk/jython/src/templates/object.derived Modified: trunk/jython/src/org/python/antlr/ast/AssertDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/AssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/AttributeDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/BinOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/BreakDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/CallDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/CompareDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ContinueDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/DeleteDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/DictDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ExecDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ExprDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ForDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/GlobalDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/IfDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/IfExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ImportDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ImportDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ImportDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/IndexDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IndexDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/IndexDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/LambdaDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/LambdaDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/LambdaDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ListCompDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ListCompDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ListCompDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ListDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ListDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ListDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ModuleDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ModuleDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ModuleDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/NameDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/NameDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/NameDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/NumDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/NumDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/NumDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/PassDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/PassDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/PassDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/PrintDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/PrintDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/PrintDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/RaiseDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/RaiseDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/RaiseDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ReprDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ReprDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ReprDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/ReturnDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ReturnDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/ReturnDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/SliceDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/SliceDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/SliceDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/StrDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/StrDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/StrDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/SuiteDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/SuiteDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/SuiteDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/TupleDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/TupleDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/TupleDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/WhileDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/WhileDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/WhileDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/WithDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/WithDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/WithDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/YieldDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/YieldDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/YieldDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/aliasDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/aliasDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/aliasDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/argumentsDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/argumentsDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/argumentsDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/ast/keywordDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/keywordDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/ast/keywordDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/AddDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/AddDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/AddDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/AndDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/AndDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/AndDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/AugLoadDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/AugLoadDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/AugLoadDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/AugStoreDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/AugStoreDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/AugStoreDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/BitAndDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/BitAndDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/BitAndDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/BitOrDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/BitOrDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/BitOrDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/BitXorDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/BitXorDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/BitXorDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/DelDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/DelDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/DelDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/DivDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/DivDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/DivDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/EqDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/EqDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/EqDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/FloorDivDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/FloorDivDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/FloorDivDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/GtDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/GtDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/GtDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/GtEDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/GtEDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/GtEDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/InDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/InDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/InDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/InvertDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/InvertDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/InvertDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/IsDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/IsDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/IsDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/IsNotDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/IsNotDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/IsNotDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/LShiftDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/LShiftDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/LShiftDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/LoadDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/LoadDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/LoadDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/LtDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/LtDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/LtDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/LtEDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/LtEDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/LtEDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return super.__int__(); Modified: trunk/jython/src/org/python/antlr/op/ModDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/op/ModDerived.java 2009-05-10 20:29:04 UTC (rev 6331) +++ trunk/jython/src/org/python/antlr/op/ModDerived.java 2009-05-10 21:44:46 UTC (rev 6332) @@ -715,7 +715,7 @@ if (impl!=null) { PyObject res=impl.__get__(this,self_type).__call__(); if (res instanceof PyInteger||res instanceof PyLong) - return(PyObject)res; + return res; throw Py.TypeError("__int__"+" should return an integer"); } return s... [truncated message content] |
From: <pj...@us...> - 2009-05-10 20:29:14
|
Revision: 6331 http://jython.svn.sourceforge.net/jython/?rev=6331&view=rev Author: pjenvey Date: 2009-05-10 20:29:04 +0000 (Sun, 10 May 2009) Log Message: ----------- javac.args -> javac.Xlint, so we can more clearly override Xlint settings Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-10 19:10:53 UTC (rev 6330) +++ trunk/jython/build.xml 2009-05-10 20:29:04 UTC (rev 6331) @@ -120,7 +120,7 @@ <property name="deprecation" value="true" /> <property name="debug" value="true" /> <property name="nowarn" value="false" /> - <property name="javac.args" value="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-cast"/> + <property name="javac.Xlint" value="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-cast"/> <!-- properties work.dir and jython.base.dir are also defined in full-preinit --> <property name="work.dir" value="${basedir}" /> @@ -414,7 +414,7 @@ deprecation="${deprecation}" nowarn="${nowarn}"> <include name="org/python/util/TemplateAntTask.java" /> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.Xlint}"/> </javac> </target> @@ -458,7 +458,7 @@ nowarn="${nowarn}" memoryMaximumSize="192m" fork="true"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.Xlint}"/> <src path="${source.dir}"/> <src path="${gensrc.dir}"/> @@ -475,7 +475,7 @@ debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.Xlint}"/> </javac> <!-- java files used by tests --> @@ -486,7 +486,7 @@ debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.Xlint}"/> <classpath refid="test.classpath" /> </javac> <javac srcdir="tests/data/initializer" @@ -496,7 +496,7 @@ debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.Xlint}"/> <classpath refid="test.classpath" /> </javac> <copy file="${source.dir}/org/python/modules/ucnhash.dat" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 19:11:00
|
Revision: 6330 http://jython.svn.sourceforge.net/jython/?rev=6330&view=rev Author: pjenvey Date: 2009-05-10 19:10:53 +0000 (Sun, 10 May 2009) Log Message: ----------- from: http://jython-elementtree.googlecode.com/svn/trunk@74 fixed major slowdown issue (#1342) from Sebastien Boisgerault Modified Paths: -------------- trunk/jython/Lib/xml/parsers/expat.py Modified: trunk/jython/Lib/xml/parsers/expat.py =================================================================== --- trunk/jython/Lib/xml/parsers/expat.py 2009-05-10 13:41:04 UTC (rev 6329) +++ trunk/jython/Lib/xml/parsers/expat.py 2009-05-10 19:10:53 UTC (rev 6330) @@ -55,6 +55,10 @@ _xerces_parser = "org.apache.xerces.parsers.SAXParser" +# @expat args registry +_register = {} + + def ParserCreate(encoding=None, namespace_separator=None): return XMLParser(encoding, namespace_separator) @@ -228,13 +232,7 @@ return type(arg)(_encode(_arg, encoding) for _arg in iterator) -def expat(callback=None, guard="True", force=False, returns="None"): - global _register - try: - _ = _register - except NameError: - _register = {} - +def expat(callback=None, guard=True, force=False, returns=None): def _expat(method): name = method.__name__ context = id(sys._getframe(1)) @@ -247,8 +245,10 @@ parser = self.parser self._update_location(event=name) # bug if multiple method def for (method, callback, guard, force, returns) in _register[key]: - _callback = callback and eval(guard) and \ - getattr(parser, callback, None) + if guard not in (True, False): + guard = getattr(self, guard) + _callback = callback and guard and \ + getattr(parser, callback, None) if _callback or force: results = method(*args) if _callback: @@ -257,12 +257,8 @@ if not parser.returns_unicode: results = _encode(results, "utf-8") _callback(*results) - return_ = eval(returns) - if callable(return_): - return return_(*args[1:]) - else: - return return_ - break + return returns + new_method.__name__ = name #new_method.__doc__ = method.__doc__ # what to do with multiple docs ? return new_method @@ -274,7 +270,7 @@ def __init__(self, parser): self.parser = parser self._tags = {} - self.dtd = False + self.not_in_dtd = True self._entity = {} self._previous_event = None @@ -370,33 +366,26 @@ def endPrefixMapping(self, prefix): return prefix - def _empty_source(self, *args): - name, publicId, baseURI, systemId = args - source = InputSource() - byte_stream = ByteArrayInputStream(array([], "b")) - source.setByteStream(byte_stream) - source.setPublicId(publicId) - source.setSystemId(systemId) - return source + empty_source = InputSource(ByteArrayInputStream(array([], "b"))) - @expat("ExternalEntityRefHandler", guard="not self.dtd", - returns="self._empty_source") + @expat("ExternalEntityRefHandler", guard="not_in_dtd", + returns=empty_source) def resolveEntity(self, name, publicId, baseURI, systemId): context = name # wrong. see expat headers documentation. base = self.parser.GetBase() return context, base, systemId, publicId - @expat("DefaultHandlerExpand", guard="not self.dtd", - returns="self._empty_source") + @expat("DefaultHandlerExpand", guard="not_in_dtd", + returns=empty_source) def resolveEntity(self, name, publicId, baseURI, systemId): return "&%s;" % name - @expat("DefaultHandler", guard="not self.dtd", - returns="self._empty_source") + @expat("DefaultHandler", guard="not_in_dtd", + returns=empty_source) def resolveEntity(self, name, publicId, baseURI, systemId): return "&%s;" % name - @expat(force=True, returns="self._empty_source") + @expat(force=True, returns=empty_source) def resolveEntity(self, name, publicId, baseURI, systemId): pass @@ -429,13 +418,13 @@ @expat("StartDoctypeDeclHandler", force=True) def startDTD(self, name, publicId, systemId): - self.dtd = True + self.not_in_dtd = False has_internal_subset = 0 # don't know this ... return name, systemId, publicId, has_internal_subset @expat("EndDoctypeDeclHandler", force=True) def endDTD(self): - self.dtd = False + self.not_in_dtd = True def startEntity(self, name): self._entity = {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-05-10 14:22:47
|
Revision: 6329 http://jython.svn.sourceforge.net/jython/?rev=6329&view=rev Author: zyasoft Date: 2009-05-10 13:41:04 +0000 (Sun, 10 May 2009) Log Message: ----------- Cleanup - PBC compiler will be available in 2.5.1, for now this should be tracked in the pbcvm branch. Removed Paths: ------------- trunk/jython/src/org/python/compiler/pbc/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-10 08:34:55
|
Revision: 6328 http://jython.svn.sourceforge.net/jython/?rev=6328&view=rev Author: otmarhumbel Date: 2009-05-10 08:34:53 +0000 (Sun, 10 May 2009) Log Message: ----------- use the new jline .jar Modified Paths: -------------- trunk/jython/.classpath Modified: trunk/jython/.classpath =================================================================== --- trunk/jython/.classpath 2009-05-10 08:23:48 UTC (rev 6327) +++ trunk/jython/.classpath 2009-05-10 08:34:53 UTC (rev 6328) @@ -6,7 +6,7 @@ <classpathentry kind="src" path="bugtests/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry kind="lib" path="extlibs/jline-0.9.94.jar"/> + <classpathentry kind="lib" path="extlibs/jline-0.9.95-SNAPSHOT.jar"/> <classpathentry kind="lib" path="extlibs/junit-3.8.2.jar"/> <classpathentry kind="lib" path="extlibs/libreadline-java-0.8.jar"/> <classpathentry kind="lib" path="extlibs/mysql-connector-java-5.1.6.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-10 08:23:51
|
Revision: 6327 http://jython.svn.sourceforge.net/jython/?rev=6327&view=rev Author: otmarhumbel Date: 2009-05-10 08:23:48 +0000 (Sun, 10 May 2009) Log Message: ----------- small cleanup Modified Paths: -------------- trunk/jython/registry trunk/jython/src/org/python/core/PySystemState.java Modified: trunk/jython/registry =================================================================== --- trunk/jython/registry 2009-05-10 06:43:49 UTC (rev 6326) +++ trunk/jython/registry 2009-05-10 08:23:48 UTC (rev 6327) @@ -31,7 +31,7 @@ #python.verbose = message # Jython ships with a JLine console (http://jline.sourceforge.net/) -# out of the box. Setting this to the name of different console class, +# out of the box. Setting this to the name of a different console class, # new console features can be enabled. Readline support is such an # example: #python.console=org.python.util.ReadlineConsole Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-05-10 06:43:49 UTC (rev 6326) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-05-10 08:23:48 UTC (rev 6327) @@ -217,7 +217,7 @@ } private void initEncoding() { - String encoding = registry.getProperty("python.console.encoding"); + String encoding = registry.getProperty(PYTHON_CONSOLE_ENCODING); if (encoding == null) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 06:43:50
|
Revision: 6326 http://jython.svn.sourceforge.net/jython/?rev=6326&view=rev Author: pjenvey Date: 2009-05-10 06:43:49 +0000 (Sun, 10 May 2009) Log Message: ----------- enable jline by default, with: o a custom build that fixes its term settings on BSD platforms o its unicode handling disabled since we expect raw bytes o our own keybindings disabling tab completion o it or any custom python.console disabled when not interactive refs #1293 Modified Paths: -------------- trunk/jython/build.xml trunk/jython/registry trunk/jython/src/org/python/util/JLineConsole.java trunk/jython/src/org/python/util/jline-keybindings.properties trunk/jython/src/org/python/util/jython.java Added Paths: ----------- trunk/jython/extlibs/jline-0.9.95-SNAPSHOT.jar Removed Paths: ------------- trunk/jython/extlibs/jline-0.9.94.jar Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-10 06:42:35 UTC (rev 6325) +++ trunk/jython/build.xml 2009-05-10 06:43:49 UTC (rev 6326) @@ -145,7 +145,7 @@ <!-- classpaths --> <path id="main.classpath"> <pathelement path="${extlibs.dir}/libreadline-java-0.8.jar" /> - <pathelement path="${extlibs.dir}/jline-0.9.94.jar" /> + <pathelement path="${extlibs.dir}/jline-0.9.95-SNAPSHOT.jar" /> <pathelement path="${extlibs.dir}/servlet-api-2.5.jar" /> <pathelement path="${informix.jar}" /> <pathelement path="${oracle.jar}" /> @@ -503,8 +503,8 @@ todir="${compile.dir}/org/python/modules" preservelastmodified="true" /> - <copy todir="${compile.dir}/com" preservelastmodified="true"> - <fileset dir="${source.dir}/com"> + <copy todir="${compile.dir}" preservelastmodified="true"> + <fileset dir="${source.dir}"> <include name="**/*.properties" /> </fileset> </copy> @@ -562,6 +562,8 @@ <rule pattern="org.apache.xerces.**" result="org.python.apache.xerces.@1"/> <rule pattern="org.apache.wml.**" result="org.python.apache.wml.@1"/> <rule pattern="org.apache.html.**" result="org.python.apache.html.@1"/> + <zipfileset src="extlibs/jline-0.9.95-SNAPSHOT.jar"/> + <rule pattern="jline.**" result="org.python.jline.@1"/> <manifest> <attribute name="Main-Class" value="org.python.util.jython" /> <attribute name="Built-By" value="${user.name}" /> Deleted: trunk/jython/extlibs/jline-0.9.94.jar =================================================================== (Binary files differ) Added: trunk/jython/extlibs/jline-0.9.95-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: trunk/jython/extlibs/jline-0.9.95-SNAPSHOT.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/jython/registry =================================================================== --- trunk/jython/registry 2009-05-10 06:42:35 UTC (rev 6325) +++ trunk/jython/registry 2009-05-10 06:43:49 UTC (rev 6326) @@ -30,11 +30,14 @@ # this option is set from the command line. #python.verbose = message -# Setting this to the name of different console class, new console -# features can be enabled. Readline support is such an example -#python.console=org.python.util.JLineConsole +# Jython ships with a JLine console (http://jline.sourceforge.net/) +# out of the box. Setting this to the name of different console class, +# new console features can be enabled. Readline support is such an +# example: #python.console=org.python.util.ReadlineConsole #python.console.readlinelib=JavaReadline +# To activate the legacy Jython console: +#python.console=org.python.util.InteractiveConsole # Setting this to a valid codec name will cause the console to use a # different encoding when reading commands from the console. Modified: trunk/jython/src/org/python/util/JLineConsole.java =================================================================== --- trunk/jython/src/org/python/util/JLineConsole.java 2009-05-10 06:42:35 UTC (rev 6325) +++ trunk/jython/src/org/python/util/JLineConsole.java 2009-05-10 06:43:49 UTC (rev 6326) @@ -1,9 +1,18 @@ package org.python.util; import java.io.File; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + import jline.ConsoleReader; import jline.Terminal; + import org.python.core.Py; import org.python.core.PyObject; @@ -14,6 +23,8 @@ */ public class JLineConsole extends InteractiveConsole { + protected ConsoleReader reader; + public JLineConsole() { this(null); } @@ -21,36 +32,71 @@ public JLineConsole(PyObject locals) { this(locals, CONSOLE_FILENAME); try { - File historyFile = new File(System.getProperty("user.home"), - ".jline-jython.history"); + File historyFile = new File(System.getProperty("user.home"), ".jline-jython.history"); reader.getHistory().setHistoryFile(historyFile); - } catch(IOException e) { - // oh well, no history from file + } catch (IOException e) { + // oh well, no history from file } } public JLineConsole(PyObject locals, String filename) { super(locals, filename, true); + + // Disable JLine's unicode handling so it yields raw bytes + System.setProperty("jline.UnixTerminal.input.encoding", "ISO-8859-1"); + System.setProperty("jline.WindowsTerminal.input.encoding", "ISO-8859-1"); + Terminal.setupTerminal(); try { - reader = new ConsoleReader(); - } catch(IOException e) { + InputStream input = new FileInputStream(FileDescriptor.in); + // Raw bytes in, so raw bytes out + Writer output = new OutputStreamWriter(new FileOutputStream(FileDescriptor.out), + "ISO-8859-1"); + reader = new ConsoleReader(input, output, getBindings()); + } catch (IOException e) { throw new RuntimeException(e); } } + /** + * Return the JLine bindings file. + * + * This handles loading the user's custom keybindings (normally JLine does) so it can + * fallback to Jython's (which disable tab completition) when the user's are not + * available. + * + * @return an InputStream of the JLine bindings file. + */ + protected InputStream getBindings() { + String userBindings = new File(System.getProperty("user.home"), + ".jlinebindings.properties").getAbsolutePath(); + File bindingsFile = new File(System.getProperty("jline.keybindings", userBindings)); + + try { + if (bindingsFile.isFile()) { + try { + return new FileInputStream(bindingsFile); + } catch (FileNotFoundException fnfe) { + // Shouldn't really ever happen + fnfe.printStackTrace(); + } + } + } catch (SecurityException se) { + // continue + } + return getClass().getResourceAsStream("jline-keybindings.properties"); + } + public String raw_input(PyObject prompt) { String line = null; try { line = reader.readLine(prompt.toString()); - } catch(IOException io) { + } catch (IOException io) { throw Py.IOError(io); } - if(line == null) { + if (line == null) { throw Py.EOFError("Ctrl-D exit"); } return line.endsWith("\n") ? line.substring(0, line.length() - 1) : line; } - - protected ConsoleReader reader; } Modified: trunk/jython/src/org/python/util/jline-keybindings.properties =================================================================== --- trunk/jython/src/org/python/util/jline-keybindings.properties 2009-05-10 06:42:35 UTC (rev 6325) +++ trunk/jython/src/org/python/util/jline-keybindings.properties 2009-05-10 06:43:49 UTC (rev 6326) @@ -24,8 +24,10 @@ # deleting the previous character 8: DELETE_PREV_CHAR -# TAB, CTRL-I: signal that console completion should be attempted -9: COMPLETE +## TAB, CTRL-I: signal that console completion should be attempted +#9: COMPLETE +# Jython needs a real TAB, disable completion +9: UNKNOWN # CTRL-J, CTRL-M: newline 10: NEWLINE Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2009-05-10 06:42:35 UTC (rev 6325) +++ trunk/jython/src/org/python/util/jython.java 2009-05-10 06:43:49 UTC (rev 6326) @@ -137,9 +137,6 @@ // Setup the basic python system state from these options PySystemState.initialize(PySystemState.getBaseProperties(), opts.properties, opts.argv); - // Now create an interpreter - InteractiveConsole interp = newInterpreter(); - PyList warnoptions = new PyList(); for (String wopt : opts.warnoptions) { warnoptions.append(new PyString(wopt)); @@ -155,6 +152,9 @@ } } + // Now create an interpreter + InteractiveConsole interp = newInterpreter(opts.interactive); + // Print banner and copyright information (or not) if (opts.interactive && opts.notice && !opts.runModule) { System.err.println(InteractiveConsole.getDefaultBanner()); @@ -306,16 +306,25 @@ /** * Returns a new python interpreter using the InteractiveConsole subclass from the * <tt>python.console</tt> registry key. + * <p> + + * When stdin is interactive the default is {@link JLineConsole}. Otherwise the + * featureless {@link InteractiveConsole} is always used as alternative consoles cause + * unexpected behavior with the std file streams. */ - private static InteractiveConsole newInterpreter() { - try { - String interpClass = - PySystemState.registry.getProperty("python.console", - "org.python.util.InteractiveConsole"); - return (InteractiveConsole)Class.forName(interpClass).newInstance(); - } catch (Throwable t) { - return new InteractiveConsole(); + private static InteractiveConsole newInterpreter(boolean interactiveStdin) { + if (interactiveStdin) { + String interpClass = PySystemState.registry.getProperty("python.console", ""); + if (interpClass.length() > 0) { + try { + return (InteractiveConsole)Class.forName(interpClass).newInstance(); + } catch (Throwable t) { + // fall through + } + } + return new JLineConsole(); } + return new InteractiveConsole(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 06:42:37
|
Revision: 6325 http://jython.svn.sourceforge.net/jython/?rev=6325&view=rev Author: pjenvey Date: 2009-05-10 06:42:35 +0000 (Sun, 10 May 2009) Log Message: ----------- small cleanup Modified Paths: -------------- trunk/jython/src/org/python/core/util/FileUtil.java Modified: trunk/jython/src/org/python/core/util/FileUtil.java =================================================================== --- trunk/jython/src/org/python/core/util/FileUtil.java 2009-05-10 05:54:19 UTC (rev 6324) +++ trunk/jython/src/org/python/core/util/FileUtil.java 2009-05-10 06:42:35 UTC (rev 6325) @@ -66,16 +66,12 @@ } public static boolean isatty(FileDescriptor fd) { - boolean atty = false; try { - atty = imp.load("os").__getattr__("isatty").__call__(Py.java2py(fd)).__nonzero__(); + return imp.load("os").__getattr__("isatty").__call__(Py.java2py(fd)).__nonzero__(); } catch (PyException e) { - //Weak isatty check copied from jna-posix JavaPOSIX class - return (fd == FileDescriptor.in - || fd == FileDescriptor.out - || fd == FileDescriptor.err); + // Weak isatty check copied from jna-posix JavaPOSIX class + return fd == FileDescriptor.in || fd == FileDescriptor.out || fd == FileDescriptor.err; } - return atty; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 05:54:20
|
Revision: 6324 http://jython.svn.sourceforge.net/jython/?rev=6324&view=rev Author: pjenvey Date: 2009-05-10 05:54:19 +0000 (Sun, 10 May 2009) Log Message: ----------- jline's keybindings.properties from its trunk (r1.8) Added Paths: ----------- trunk/jython/src/org/python/util/jline-keybindings.properties Added: trunk/jython/src/org/python/util/jline-keybindings.properties =================================================================== --- trunk/jython/src/org/python/util/jline-keybindings.properties (rev 0) +++ trunk/jython/src/org/python/util/jline-keybindings.properties 2009-05-10 05:54:19 UTC (rev 6324) @@ -0,0 +1,62 @@ +# Keybinding mapping for JLine. The format is: +# [key code]: [logical operation] + +# CTRL-B: move to the previous character +2: PREV_CHAR + +# CTRL-G: move to the previous word +7: PREV_WORD + +# CTRL-F: move to the next character +6: NEXT_CHAR + +# CTRL-A: move to the beginning of the line +1: MOVE_TO_BEG + +# CTRL-D: close out the input stream +4: EXIT + +# CTRL-E: move the cursor to the end of the line +5: MOVE_TO_END + +# BACKSPACE, CTRL-H: delete the previous character +# 8 is the ASCII code for backspace and therefor +# deleting the previous character +8: DELETE_PREV_CHAR + +# TAB, CTRL-I: signal that console completion should be attempted +9: COMPLETE + +# CTRL-J, CTRL-M: newline +10: NEWLINE + +# CTRL-K: erase the current line +11: KILL_LINE + +# ENTER: newline +13: NEWLINE + +# CTRL-L: clear screen +12: CLEAR_SCREEN + +# CTRL-N: scroll to the next element in the history buffer +14: NEXT_HISTORY + +# CTRL-P: scroll to the previous element in the history buffer +16: PREV_HISTORY + +# CTRL-R: redraw the current line +18: REDISPLAY + +# CTRL-U: delete all the characters before the cursor position +21: KILL_LINE_PREV + +# CTRL-V: paste the contents of the clipboard (useful for Windows terminal) +22: PASTE + +# CTRL-W: delete the word directly before the cursor +23: DELETE_PREV_WORD + +# DELETE, CTRL-?: delete the previous character +# 127 is the ASCII code for delete +127: DELETE_PREV_CHAR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 03:23:37
|
Revision: 6323 http://jython.svn.sourceforge.net/jython/?rev=6323&view=rev Author: pjenvey Date: 2009-05-10 03:23:35 +0000 (Sun, 10 May 2009) Log Message: ----------- quiet harmless unbootstrapped warnings during the expose task Modified Paths: -------------- trunk/jython/src/org/python/expose/generate/ExposeTask.java Modified: trunk/jython/src/org/python/expose/generate/ExposeTask.java =================================================================== --- trunk/jython/src/org/python/expose/generate/ExposeTask.java 2009-05-10 01:34:53 UTC (rev 6322) +++ trunk/jython/src/org/python/expose/generate/ExposeTask.java 2009-05-10 03:23:35 UTC (rev 6323) @@ -8,6 +8,8 @@ import org.apache.tools.ant.BuildException; import org.objectweb.asm.ClassWriter; +import org.python.core.Py; +import org.python.core.Options; import org.python.util.GlobMatchingTask; public class ExposeTask extends GlobMatchingTask { @@ -29,6 +31,18 @@ } else if (toExpose.size() == 1) { log("Exposing 1 class"); } + + // Quiet harmless unbootstrapped warnings during the expose process + int verbose = Options.verbose; + Options.verbose = Py.ERROR; + try { + expose(toExpose); + } finally { + Options.verbose = verbose; + } + } + + private void expose(Set<File> toExpose) { for (File f : toExpose) { ExposedTypeProcessor etp; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 02:14:28
|
Revision: 6322 http://jython.svn.sourceforge.net/jython/?rev=6322&view=rev Author: pjenvey Date: 2009-05-10 01:34:53 +0000 (Sun, 10 May 2009) Log Message: ----------- drive encoding from python.console.encoding falling back to file.encoding Modified Paths: -------------- trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/org/python/util/jython.java Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-05-10 00:00:52 UTC (rev 6321) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-05-10 01:34:53 UTC (rev 6322) @@ -36,6 +36,7 @@ { public static final String PYTHON_CACHEDIR = "python.cachedir"; public static final String PYTHON_CACHEDIR_SKIP = "python.cachedir.skip"; + public static final String PYTHON_CONSOLE_ENCODING = "python.console.encoding"; protected static final String CACHEDIR_DEFAULT_NAME = "cachedir"; public static final String JYTHON_JAR = "jython.jar"; @@ -216,12 +217,7 @@ } private void initEncoding() { - String encoding; - try { - encoding = System.getProperty("file.encoding"); - } catch (SecurityException se) { - encoding = null; - } + String encoding = registry.getProperty("python.console.encoding"); if (encoding == null) { return; } @@ -631,6 +627,15 @@ registry.put(PYTHON_CACHEDIR_SKIP, "true"); } } + if (!registry.containsKey(PYTHON_CONSOLE_ENCODING)) { + String encoding; + try { + encoding = System.getProperty("file.encoding"); + } catch (SecurityException se) { + encoding = null; + } + registry.put(PYTHON_CONSOLE_ENCODING, encoding); + } // Set up options from registry Options.setFromRegistry(); } Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2009-05-10 00:00:52 UTC (rev 6321) +++ trunk/jython/src/org/python/util/jython.java 2009-05-10 01:34:53 UTC (rev 6322) @@ -280,8 +280,7 @@ if (opts.fixInteractive || (opts.filename == null && opts.command == null)) { if (opts.encoding == null) { - opts.encoding = PySystemState.registry.getProperty( - "python.console.encoding", null); + opts.encoding = PySystemState.registry.getProperty("python.console.encoding"); } if (opts.encoding != null) { if (!Charset.isSupported(opts.encoding)) { @@ -422,6 +421,7 @@ warnoptions.add(args[++index]); } else if (arg.equals("-C")) { encoding = args[++index]; + setProperty("python.console.encoding", encoding); } else if (arg.equals("-E")) { // XXX: accept -E (ignore environment variables) to be compatiable with // CPython. do nothing for now (we could ignore the registry) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-10 00:01:11
|
Revision: 6321 http://jython.svn.sourceforge.net/jython/?rev=6321&view=rev Author: pjenvey Date: 2009-05-10 00:00:52 +0000 (Sun, 10 May 2009) Log Message: ----------- o set std{in,out,err}.encoding to the file.encoding property (which is usually accurate), and only when those are ttys fixes #1314 o force file.encoding to utf-8 on darwin instead of MacRoman. JRuby also does this, CPython uses utf-8 there too Modified Paths: -------------- trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/shell/jython Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-05-09 22:30:55 UTC (rev 6320) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-05-10 00:00:52 UTC (rev 6321) @@ -164,20 +164,20 @@ // Set up the initial standard ins and outs String mode = Options.unbuffered ? "b" : ""; int buffering = Options.unbuffered ? 0 : 1; - stdout = new PyFile(System.out, "<stdout>", "w" + mode, buffering, false); - stderr = new PyFile(System.err, "<stderr>", "w" + mode, 0, false); - stdin = new PyFile(System.in, "<stdin>", "r" + mode, buffering, false); + stdin = __stdin__ = new PyFile(System.in, "<stdin>", "r" + mode, buffering, false); + stdout = __stdout__ = new PyFile(System.out, "<stdout>", "w" + mode, buffering, false); + stderr = __stderr__ = new PyFile(System.err, "<stderr>", "w" + mode, 0, false); + if (Py.getSystemState() != null) { + // XXX: initEncoding fails without an existing sys module as it can't import + // os (for os.isatty). In that case PySystemState.doInitialize calls it for + // us. The correct fix for this is rewriting the posix/nt module portions of + // os in Java + initEncoding(); + } + __displayhook__ = new PySystemStateFunctions("displayhook", 10, 1, 1); __excepthook__ = new PySystemStateFunctions("excepthook", 30, 3, 3); - String encoding = registry.getProperty("python.console.encoding", "US-ASCII"); - ((PyFile)stdout).encoding = encoding; - ((PyFile)stderr).encoding = encoding; - ((PyFile)stdin).encoding = encoding; - __stdout__ = stdout; - __stderr__ = stderr; - __stdin__ = stdin; - if (builtins == null) { builtins = getDefaultBuiltins(); } @@ -215,6 +215,25 @@ } } + private void initEncoding() { + String encoding; + try { + encoding = System.getProperty("file.encoding"); + } catch (SecurityException se) { + encoding = null; + } + if (encoding == null) { + return; + } + + for (PyFile stdStream : new PyFile[] {(PyFile)this.stdin, (PyFile)this.stdout, + (PyFile)this.stderr}) { + if (stdStream.isatty()) { + stdStream.encoding = encoding; + } + } + } + // might be nice to have something general here, but for now these // seem to be the only values that need to be explicitly shadowed private Shadow shadowing; @@ -815,6 +834,8 @@ Py.defaultSystemState.setClassLoader(classLoader); } Py.initClassExceptions(getDefaultBuiltins()); + // defaultSystemState can't init its own encoding, see its constructor + Py.defaultSystemState.initEncoding(); // Make sure that Exception classes have been loaded new PySyntaxError("", 1, 1, "", ""); return Py.defaultSystemState; Modified: trunk/jython/src/shell/jython =================================================================== --- trunk/jython/src/shell/jython 2009-05-09 22:30:55 UTC (rev 6320) +++ trunk/jython/src/shell/jython 2009-05-10 00:00:52 UTC (rev 6321) @@ -16,7 +16,8 @@ # ----- Identify OS we are running under -------------------------------------- case "`uname`" in - CYGWIN*) cygwin=true + CYGWIN*) cygwin=true;; + Darwin) darwin=true;; esac # ----- Verify and set required environment variables ------------------------- @@ -107,6 +108,8 @@ JAVA_STACK=-Xss1024k fi +JAVA_ENCODING="" + # Split out any -J argument for passing to the JVM. # Scanning for args is aborted by '--'. while [ $# -gt 0 ] ; do @@ -127,7 +130,10 @@ echo "(Prepend -J in front of these options when using 'jython' command)" exit else - java_args=("${java_args[@]}" "${1:2}") + if [ "${val:0:16}" = "-Dfile.encoding=" ]; then + JAVA_ENCODING=$val + fi + java_args=("${java_args[@]}" "${1:2}") fi ;; # Match switches that take an argument @@ -195,6 +201,11 @@ shift done +# Force file.encoding to UTF-8 when on Mac, since Apple JDK defaults to MacRoman (JRUBY-3576) +if [[ $darwin && -z "$JAVA_ENCODING" ]]; then + java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8") +fi + # Append the rest of the arguments python_args=("${python_args[@]}" "$@") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-09 22:31:12
|
Revision: 6320 http://jython.svn.sourceforge.net/jython/?rev=6320&view=rev Author: pjenvey Date: 2009-05-09 22:30:55 +0000 (Sat, 09 May 2009) Log Message: ----------- less verbose unbootstraped message Modified Paths: -------------- trunk/jython/src/org/python/core/PyObject.java Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2009-05-09 21:06:49 UTC (rev 6319) +++ trunk/jython/src/org/python/core/PyObject.java 2009-05-09 22:30:55 UTC (rev 6320) @@ -47,6 +47,12 @@ primitiveMap.put(Long.TYPE, Long.class); primitiveMap.put(Float.TYPE, Float.class); primitiveMap.put(Double.TYPE, Double.class); + + if (Py.BOOTSTRAP_TYPES.size() > 0) { + Py.writeWarning("init", "Bootstrap types weren't encountered in bootstrapping: " + + Py.BOOTSTRAP_TYPES); + + } } public PyObject(PyType objtype) { @@ -4068,13 +4074,6 @@ // OverflowErrors are handled in PyLong.asIndex return __index__().asInt(); } - - static { - for (Class<?> unbootstrapped : Py.BOOTSTRAP_TYPES) { - Py.writeWarning("init", "Bootstrap type wasn't encountered in bootstrapping[class=" - + unbootstrapped + "]"); - } - } } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |