From: <otm...@us...> - 2007-08-20 06:13:33
|
Revision: 3419 http://jython.svn.sourceforge.net/jython/?rev=3419&view=rev Author: otmarhumbel Date: 2007-08-19 23:13:31 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/registry Removed Paths: ------------- branches/Release_2_2maint/registry Copied: branches/Release_2_2maint/jython/registry (from rev 3418, branches/Release_2_2maint/registry) =================================================================== --- branches/Release_2_2maint/jython/registry (rev 0) +++ branches/Release_2_2maint/jython/registry 2007-08-20 06:13:31 UTC (rev 3419) @@ -0,0 +1,116 @@ +# Python Registry -*- ksh -*- +# This default registry sets many common options to their default values +# All of these settings could be erased with no change in behavior + +# This is how Jim sets his path on his Windows development machine +#python.path=.;c:\\Jython\\Lib;d:\\Python-1.5.2\\Lib +# This is how Barry sets his path on his Unix development machine +#python.path = /home/bwarsaw/projects/python/Lib +# This is how Finn sets his path on his windows development machine +#python.path = d:\\python20\\lib + +# Set the directory to use for caches (currently just package information) +# This directory should be writable by the user +# If this is an absolute path it is used as given +# Otherwise it is interpreted relative to sys.prefix +# (typically the directory of this file) +python.cachedir = cachedir + +# Setting this property to true disables the package scan for the cachedir. +# Please be aware that disabling this might break some java import statements +#python.cachedir.skip = false + +# Properties to check for initializing and updating the package cache +# Hopefully you won't have any need to change these +python.packages.paths = java.class.path, sun.boot.class.path +python.packages.directories = java.ext.dirs + +# To force JIT compilation of Jython code -- should be unnecessary +# Setting this to true will cause jdk1.2rc1 to core dump on Windows +python.options.compileClass = false + +# Set verbosity to error, warning, message, comment, or debug +# for varying levels of informative messages from Jython. Normally +# this option is set from the command line. +#python.verbose = message + +# Setting this to true will support old 1.0 style keyword+"_" names +# This isn't needed any more due to improvements in the parser +python.deprecated.keywordMangling = false + +# 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 + +# Setting this to true will cause the console to poll standard in +# This might be helpful on systems without system-level threads +python.console.poll = false + +# Setting this to a valid codec name will cause the console to use a +# different encoding when reading commands from the console. +# The default java encoding is still used when reading python sources +# from the filesystem. +#python.console.encoding = cp850 + +# Setting this to false will allow Jython to provide access to +# non-public fields, methods, and constructors of Java objects. +python.security.respectJavaAccessibility = true + +# List of choices for internal tables impl (PyJavaClasses canonical map etc.), +# these are separated through ':' and tryed from left to right. +# For long running applications under java2, needing classes unloading, +# in order to have jython runtime automatically discarding +# no longer needed info and avoding memory leakage, this can be set +# to weak or soft (=> an impl. using weak-refs or soft-refs will be used). +#python.options.internalTablesImpl = soft +#python.options.internalTablesImpl = weak + +# Setting this to true will force Jython will use the first module +# found on sys.path where java File.isFile() returns true. +# Setting this to true has no effect on unix-type filesystems. +# On Windows/HPS+ systems, setting it to true will enable Jython-2.0 +# behaviour. +python.options.caseok = false + + +# Use this registry entry to control the list of builtin modules; you +# can add, remove, or override builtin modules. The value for this +# registry key is a comma separated list of module entries, each entry +# of which has the following allowable forms: +# +# name +# The module name is `name' and the class name is +# org.python.modules.name +# +# name:class +# The module name is `name' and the class name is `class' where +# class must be a fully qualified Java class name +# +# name:null +# The module `name' is removed from the list of builtin modules +# +# A good example would be to use a jni version of os for more +# functionality by having an entry such as os:com.foo.jni.os +#python.modules.builtin = whatever + +# This specifies the command used by jythonc to compile Java source +# code, along with the complete classpath to use. +# python.jythonc.compiler = /depot/java/plat/bin/jikes +# python.jythonc.classpath = /usr/java1.2/jre/lib/rt.jar:/Jython/dist:. +# python.jythonc.compileropts = +E +D -g + +# python.environment controls the type of environment support provided +# by the os module. Default behavior for known operating systems is to +# generate the environment by executing shell commands appropriate to +# the operating system. For unknown operating systems, provide an +# empty environment. Uncomment this line for an empty environment +# on all operating systems. +#python.environment=None + +# python.os determines operating-specific features, similar to and overriding the +# Java property "os.name". +# Some generic values are also supported: 'nt', 'dos', 'mac' and 'posix'. +# Uncomment the following line for the most generic OS behavior available. +#python.os=None + Deleted: branches/Release_2_2maint/registry =================================================================== --- branches/Release_2_2maint/registry 2007-08-20 06:08:17 UTC (rev 3418) +++ branches/Release_2_2maint/registry 2007-08-20 06:13:31 UTC (rev 3419) @@ -1,116 +0,0 @@ -# Python Registry -*- ksh -*- -# This default registry sets many common options to their default values -# All of these settings could be erased with no change in behavior - -# This is how Jim sets his path on his Windows development machine -#python.path=.;c:\\Jython\\Lib;d:\\Python-1.5.2\\Lib -# This is how Barry sets his path on his Unix development machine -#python.path = /home/bwarsaw/projects/python/Lib -# This is how Finn sets his path on his windows development machine -#python.path = d:\\python20\\lib - -# Set the directory to use for caches (currently just package information) -# This directory should be writable by the user -# If this is an absolute path it is used as given -# Otherwise it is interpreted relative to sys.prefix -# (typically the directory of this file) -python.cachedir = cachedir - -# Setting this property to true disables the package scan for the cachedir. -# Please be aware that disabling this might break some java import statements -#python.cachedir.skip = false - -# Properties to check for initializing and updating the package cache -# Hopefully you won't have any need to change these -python.packages.paths = java.class.path, sun.boot.class.path -python.packages.directories = java.ext.dirs - -# To force JIT compilation of Jython code -- should be unnecessary -# Setting this to true will cause jdk1.2rc1 to core dump on Windows -python.options.compileClass = false - -# Set verbosity to error, warning, message, comment, or debug -# for varying levels of informative messages from Jython. Normally -# this option is set from the command line. -#python.verbose = message - -# Setting this to true will support old 1.0 style keyword+"_" names -# This isn't needed any more due to improvements in the parser -python.deprecated.keywordMangling = false - -# 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 - -# Setting this to true will cause the console to poll standard in -# This might be helpful on systems without system-level threads -python.console.poll = false - -# Setting this to a valid codec name will cause the console to use a -# different encoding when reading commands from the console. -# The default java encoding is still used when reading python sources -# from the filesystem. -#python.console.encoding = cp850 - -# Setting this to false will allow Jython to provide access to -# non-public fields, methods, and constructors of Java objects. -python.security.respectJavaAccessibility = true - -# List of choices for internal tables impl (PyJavaClasses canonical map etc.), -# these are separated through ':' and tryed from left to right. -# For long running applications under java2, needing classes unloading, -# in order to have jython runtime automatically discarding -# no longer needed info and avoding memory leakage, this can be set -# to weak or soft (=> an impl. using weak-refs or soft-refs will be used). -#python.options.internalTablesImpl = soft -#python.options.internalTablesImpl = weak - -# Setting this to true will force Jython will use the first module -# found on sys.path where java File.isFile() returns true. -# Setting this to true has no effect on unix-type filesystems. -# On Windows/HPS+ systems, setting it to true will enable Jython-2.0 -# behaviour. -python.options.caseok = false - - -# Use this registry entry to control the list of builtin modules; you -# can add, remove, or override builtin modules. The value for this -# registry key is a comma separated list of module entries, each entry -# of which has the following allowable forms: -# -# name -# The module name is `name' and the class name is -# org.python.modules.name -# -# name:class -# The module name is `name' and the class name is `class' where -# class must be a fully qualified Java class name -# -# name:null -# The module `name' is removed from the list of builtin modules -# -# A good example would be to use a jni version of os for more -# functionality by having an entry such as os:com.foo.jni.os -#python.modules.builtin = whatever - -# This specifies the command used by jythonc to compile Java source -# code, along with the complete classpath to use. -# python.jythonc.compiler = /depot/java/plat/bin/jikes -# python.jythonc.classpath = /usr/java1.2/jre/lib/rt.jar:/Jython/dist:. -# python.jythonc.compileropts = +E +D -g - -# python.environment controls the type of environment support provided -# by the os module. Default behavior for known operating systems is to -# generate the environment by executing shell commands appropriate to -# the operating system. For unknown operating systems, provide an -# empty environment. Uncomment this line for an empty environment -# on all operating systems. -#python.environment=None - -# python.os determines operating-specific features, similar to and overriding the -# Java property "os.name". -# Some generic values are also supported: 'nt', 'dos', 'mac' and 'posix'. -# Uncomment the following line for the most generic OS behavior available. -#python.os=None - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:14:55
|
Revision: 3420 http://jython.svn.sourceforge.net/jython/?rev=3420&view=rev Author: otmarhumbel Date: 2007-08-19 23:14:48 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/README.txt Removed Paths: ------------- branches/Release_2_2maint/README.txt Deleted: branches/Release_2_2maint/README.txt =================================================================== --- branches/Release_2_2maint/README.txt 2007-08-20 06:13:31 UTC (rev 3419) +++ branches/Release_2_2maint/README.txt 2007-08-20 06:14:48 UTC (rev 3420) @@ -1,30 +0,0 @@ -Welcome to Jython 2.2rc3 -======================= - -This is the third release candidate of the 2.2 version of Jython. It -contains all of the new features for the 2.2 release: - - new-style classes - - Java List integration - - a PEP 302 implementation - - iterators - - generators - - __future__ division - - support for running on modern JVMs - - a new installer - - ssl and non-blocking support for socket - -In addition to these major features, several bugs have been fixed from 2.2rc2. -See the NEWS file for a more complete list of changes. - -The release was compiled on Mac OS X with JDK 5 but it should run on -1.4.2+. - -This release is intended to find any major bugs before releasing 2.2. If none -are found, this will become the 2.2 release. If you can run this and check for -bugs, it will be greatly appreciated. Bug reports can be created at -http://jython.org/bugs whereas more general questions can be sent to the -Jython-users mailing list, jyt...@li.... - -If this release proves stable, the final release of 2.2 will be in a couple -weeks. If not, successive release candidates will be made until all the major -bugs are ironed out. Copied: branches/Release_2_2maint/jython/README.txt (from rev 3419, branches/Release_2_2maint/README.txt) =================================================================== --- branches/Release_2_2maint/jython/README.txt (rev 0) +++ branches/Release_2_2maint/jython/README.txt 2007-08-20 06:14:48 UTC (rev 3420) @@ -0,0 +1,30 @@ +Welcome to Jython 2.2rc3 +======================= + +This is the third release candidate of the 2.2 version of Jython. It +contains all of the new features for the 2.2 release: + - new-style classes + - Java List integration + - a PEP 302 implementation + - iterators + - generators + - __future__ division + - support for running on modern JVMs + - a new installer + - ssl and non-blocking support for socket + +In addition to these major features, several bugs have been fixed from 2.2rc2. +See the NEWS file for a more complete list of changes. + +The release was compiled on Mac OS X with JDK 5 but it should run on +1.4.2+. + +This release is intended to find any major bugs before releasing 2.2. If none +are found, this will become the 2.2 release. If you can run this and check for +bugs, it will be greatly appreciated. Bug reports can be created at +http://jython.org/bugs whereas more general questions can be sent to the +Jython-users mailing list, jyt...@li.... + +If this release proves stable, the final release of 2.2 will be in a couple +weeks. If not, successive release candidates will be made until all the major +bugs are ironed out. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:16:23
|
Revision: 3421 http://jython.svn.sourceforge.net/jython/?rev=3421&view=rev Author: otmarhumbel Date: 2007-08-19 23:16:21 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/NOTICE.txt Removed Paths: ------------- branches/Release_2_2maint/NOTICE.txt Deleted: branches/Release_2_2maint/NOTICE.txt =================================================================== --- branches/Release_2_2maint/NOTICE.txt 2007-08-20 06:14:48 UTC (rev 3420) +++ branches/Release_2_2maint/NOTICE.txt 2007-08-20 06:16:21 UTC (rev 3421) @@ -1,3 +0,0 @@ -This product includes software developed by: - o The Apache Software Foundation (http://www.apache.org/) - Copied: branches/Release_2_2maint/jython/NOTICE.txt (from rev 3420, branches/Release_2_2maint/NOTICE.txt) =================================================================== --- branches/Release_2_2maint/jython/NOTICE.txt (rev 0) +++ branches/Release_2_2maint/jython/NOTICE.txt 2007-08-20 06:16:21 UTC (rev 3421) @@ -0,0 +1,3 @@ +This product includes software developed by: + o The Apache Software Foundation (http://www.apache.org/) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:16:58
|
Revision: 3422 http://jython.svn.sourceforge.net/jython/?rev=3422&view=rev Author: otmarhumbel Date: 2007-08-19 23:16:55 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/NEWS Removed Paths: ------------- branches/Release_2_2maint/NEWS Deleted: branches/Release_2_2maint/NEWS =================================================================== --- branches/Release_2_2maint/NEWS 2007-08-20 06:16:21 UTC (rev 3421) +++ branches/Release_2_2maint/NEWS 2007-08-20 06:16:55 UTC (rev 3422) @@ -1,657 +0,0 @@ -Jython NEWS - -Jython 2.2 rc3 - New Features - - Added telnetlib from CPython - - Added cpython_compatible_select to select. See - http://wiki.python.org/jython/SelectModule for information on when - to use it. - - Several more java.nio exceptions are mapped to their corresponding - Python error codes when thrown. - Bugs fixed - - recv on closed sockets threw an exception instead returning the - empty string - - A PySystemState being garbage collected caused System.out and - System.in to be closed. This would cause 'print' to stop working. - - Closing a FileWrapper on a socket closes its underlying socket - - Sockets just have their [In|Out]putStreams closed instead of being - properly shutdown by shutdown() - - SO_REUSEADDR is reset on sockets from a server socket's accept call - causing later binds to the server socket's port to fail. - - Client sockets that have bind called before connect don't respect - SO_REUSEADDR - - [ 1758838 ] execfile() throws a NullPointerException in the interactive - console - -Jython 2.2 rc2 - Bugs fixed - - [ 931129 ] jython -jar some-path/test.jar fails - - [ 1719528 ] -c doesn't put the empty string in sys.path - - [ 1746957 ] Weird 'uu' prefix for unicode - - [ 1747092 ] Failed imports should not be "cached" - - [ 1742770 ] urllib.urlopen('http://inv') -> UnknownHostException - - [ 1745068 ] select gives confusing message when given blocking sockets - - [ 1744775 ] umlauts displayed incorrectly in installer - - timeouts on socket client connects were not being honoured - - a float could not be passed as milliseconds to select.poll.poll - -Jython 2.2 rc1 - New features - - Completely rewritten socket module and new select module using java.nio - which allows the use of SSL and non-blocking sockets. - - Explicit imports of Java classes like 'from java.net import URL' or - 'import java.net.URL' work with package scanning disabled. - Bugs fixed - - [ 1708080 ] float("1d") -> 1.0 (not ValueError as expected) - - [ 1661700 ] os.path.abspath raises IOException if drive not accessible - - [ 1662689 ] os.path.abspath eliminates symlinks - - [ 1717498 ] os.path.splitdrive does nothing for Windows drives - - [ 1622207 ] _weakref.ref(o) only works if the argument is hasheable - - [ 1735864 ] Parser not threadsafe - - [ 1722306 ] OverflowError in UDP Socket Implementation - - [ 1348645 ] socket.py send() requires too many arguments - - [ 998602 ] urllib : https request does not work - - [ 621180 ] module socket _udpsocket close bug - -Jython 2.2 beta2 - New features - - All functions in __builtin__ are new style functions instead of reflected - functions - - Classmethods added to newstyle classes - - array is a newstyle class - - org.python.util.JLineConsole provides readline-like functionality with - JLine without requiring native readline - - Bugs fixed - - [ 1599012 ] current directory is prepended to entries in sys.path - - [ 1654484 ] Initializing PyJavaClass for java.lang.OutOfMemory causes a further OutOfMemory problem - - [ 1661679 ] types.UnicodeType is str - - [ 1659819 ] Joining unicode items with string doesn't create unicode - - [ 1603253 ] Thread's setDaemon setting does not work - - types module uses newstyle classes - - [ 1671134 ] '%s' % u'x' returns str object - - [ 1672800 ] __import__('module', None) raises AttributeError - - [ 1576036 ] Fix: SyspathJavaLoader file reader causes importerror - - [ 1605847 ] co_filename set in bytecode doesn't match __file__ - - [ 1603312 ] subclasses of int raise a TypeError when given large value - - [ 1603315 ] str missing object keyword arg - - [ 1603747 ] Multiple InteractiveInterpreter share same setErr/Out - - [ 1619040 ] dict.fromkeys() should take iterable - - [ 1658647 ] type(x) calls x.__class__.__init__ - - [ 1699556 ] SAXException descends from Java's Exception instead of Python's - - [ 1603686 ] Unmarshaling long-error - - [ 1230674 ] eval with from future does not work through import - - [ 663592 ] Problems calling an overriden class in the constructor - - [ 448398 ] open('test.txt', 'w').write('test') fails - - [ 1671373 ] A "$_PyInner.class" file in a package causes import to fail - - [ 1671431 ] dir function does not work with database connection object - - [ 1713513 ] os.environ fails in Windows Vista JDK 1.6_01 - Patches applied - - [ 1681774 ] str.decode, unicode.encode and str(u'') fixes - - [ 1682423 ] Convert PyModule to a new-style class - - [ 1682498 ] Fix int(None) raising an AttributeError - - [ 1684172 ] Changes to make compileall work - - [ 1628469 ] fixes for failing builtin tests - - -Jython 2.2 beta1 - New features - - much improved support for __unicode__ especially in the parser (u"string" and - friends now result in a PyUnicode object) - - added datetime support using the pure python datetime.py from cpython non-dist. - - new-style classes and their instances are Java serializable - - most new-style builtin types can be pickleds - - __slots__ for new-style classes - - xml modules from pyxml readded - - comparison operations between subclasses of - builtin types tries the subclass first even if it's on the right side - Bugs fixed. - - Modules that throw exceptions while being imported aren't left - in sys.modules - - Don't allow sys.recursionlimit to be set below 0 - - [ 1533624 ] NPE thrown building traceback for a call that jumps - threads - - [ 1531644 ] import * makes java exception uncatchable - - [1243049, 1218089] Can't subclass builtin types in 2.2a1 - - [1256506] Importing directory module with 12+ char name fails - - [1512745] Allow arbitrary precision for formatted strings, - but only 250 chars for decimal, integer and long - - [1506749] Instance __dict__ are unassignable - - [1599004] several fixes to get the sha module up to speed - - [1616493] unicode objects can't be passed to os.path - methods - - [ 979157 ] Stack traces untrimmed - - [ 1299032 ] os.getenv out of sync with cpython - - [ 738951 ] jython slice behavior differs from python in __getattr__ - - [ 610576 ] Impl of abstract method not found - - [ 1374088 ] keyword args to dict() constructor ignored - - [ 730082 ] new can't create unbound methods - - [ 1382581 ] double(s) read inaccurately from database - - [ 1603312 ] subclasses of int raise a TypeError when given large - value - - [1465476] bad parenthesis nesting terminates interpreter - - [ 1227282 ] Deadlock between PythonTraceFunction.safeCall() and - imp.import - - [ 1421812 ] Jython 2.2a and 2.1 imports directories as modules - - [ 480017 ] Proxy super classes are loaded from syspath, not the - proxy's classpath - - [ 628315 ] problem with Java synchronized lists - - [ 1284344 ] __file__ compiled into .py.class file - - [ 610576 ] Impl of abstract method not found - Patches applied. - - [906256] Follow spec for read modes of open() - - [868514] yield in finally block -- yield in nested try:except: - - [1542997] Only evaluate the second expression in an assert - if the first expression is false - - [1612711]: add iterkeys, itervalues and iteritems to - PyStringMap - - [ 1267425 ] make cStringIO work with gzip.py - - [ 1361317 ] __set__ failing on PyProperty - - -17-jul-2005 Jython 2.2 alpha1 - - New features - - Integrated patch (by Aleks Totic) that allows to use the Python parser - outside of Jython. PythonGrammar grows two constructors, one of which - _must_ be used: - PythonGrammar(CharStream stream,IParserHost host) - PythonGrammar(PythonGrammarTokenManager tm, IParserHost host) - They both takes an impl of org.python.parser.IParserHost to which - literal building is delegated. org.python.core.parser contains the - source of the impl used by Jython. - - New-style classes - - PEP 302 implementation - - Java collections integration - - finished long/int unification -- PyObject.__int__() now returns a - PyObject (which could be a PyInteger or a PyLong). - - dict and list conform to CPython 2.3 behaviors (such as the 3 arg - list.index()). - - new-style conversion of tuple, float, file and str. - - Preliminary work on a unicode type. - - Imported tempfile.py and userlist.py from CPython 2.3 and applied some - small adjustments to get tests to pass. - - Reworked message construction for TypeError exceptions - (such as the exceptions generated from operations like [] + ""). - -31-jul-2003 Jython 2.2 alpha0 - - New features - - Iterators (pep-234). - - Changing the Division Operator (pep-238) - - Implemented a new compiler AST. - - Quitting (Ctrl-Z/D) Jython in interactive mode will force the running JVM - to exit, even if there are non-daemon threads (e.g. AWT), this is likely - the expected behavior. The behavior for (non-interactive) scripts is - unchanged and still matches that of Java programs. - - OutOfMemoryError can be caught, also matching MemoryError, that means - that a caught PyException.value.__tojava__(Throwable.class) - can potentially be a OutOfMemoryError instance. This is different from - the old aborting behavior (System.exit was called) [change needed to pass - a test in CPython test_b1]. - - Bug fixes. - - Renamed the use of the java1.4 reserved words 'assert'. - - [ #222805 ] multi-line statements in the JPython interpreter - - [ #495866 ] need dynamic scale for BigDecimal - - [ #499973 ] isql.Prompt can't be written to stdout. - - [ #508111 ] jythonc generates invalid statements - - [ #511493 ] jreload truncates large class files - - [ #515894 ] Behaviour of "+=" stm. is different from - - [ #517237 ] Binary ops with int and long fail - - [ #521704 ] no errno module - - [ #522423 ] cStringIO has no reset() method - - [ #522558 ] list() is broken - - [ #522828 ] struct.pack('>NNs', v) fails for NN > 20 - - [ #529242 ] Python singletons deserialization bug - - [ #532747 ] for i in iter(d) - - [ #533354 ] bug in xml.dom.minidom.parseString - - [ #533541 ] send() on _udpsocket fails - - [ #544891 ] problems with socket.py - - [ #545235 ] unexpected match with re - - [ #549107 ] .__doc__ doesn't work in jython - - [ #562943 ] os.path.getmtime misbehaves on nonfile - - [ #567844 ] list() does not make a shallow copy - - [ #572769 ] Blank input lines break readline console - - [ #573784 ] popen does not work - - [ #573791 ] os.system partly broken - - [ #575110 ] Multiple for's on Collection broken - - [ #577395 ] Outer finally not executed at return - - [ #581785 ] bug in 4DOM - - [ #582618 ] Case insensitive re.match fails - - [ #608628 ] long(java.math.BigInteger) does not work - - [ #609505 ] SQLWarning tuples not populated - - [ #620978 ] Variable default for Options.caseok - - [ #625364 ] sys.last_traceback not set? - - [ #631017 ] Private fields mismangled - - [ #631035 ] Negative repeat cause java exception. - - [ #631430 ] read(-1) uses wrong fileposition. - - [ #636381 ] Match Error for +? pattern element - - [ #654863 ] string.split behaves differently - - [ #668194 ] broken non greedy regular expressions - -31-dec-2001 Jython 2.1 final - - Bug fixes. - - [ #493359 ] Installer should include <EXIT> button - - [ #495602 ] os.path.dirname() can result in an NPE - - [ #495604 ] imp.find_module fails when None is 2 arg - -21-dec-2001 Jython 2.1 beta 2 - - New features. - - support for callproc() in zxJDBC is now available for most simple - stored procedure calls. - - Bug fixes. - - [ #451552 ] case insensitivity on import causes prob - - [ #456926 ] PackageManager doesn't work correctly - - [ #484949 ] __import__(_) does unwanted rel search - - [ #488632 ] -c sys.argv diff - - [ #489168 ] Parse error, java traceback - - [ #489836 ] Private names is not mangled - - [ #490157 ] string.splitlines() - incorrectly splits - - [ #490230 ] NotImplemented not implemented - - [ #490961 ] PyFile.java requires JDK 1.2 - - [ #490962 ] Typo in PyFile.java - - [ #490963 ] Please update ReadlineConsole.java - - [ #494514 ] Python object not gc()'d - - [ #495458 ] multi level import from .zip file. - - [ #495870 ] zxJDBC now only prepares statements with params. - -03-dec-2001 Jython 2.1 beta 1 - - New features. - - The weakref module is now available. - - The sys.exitfunc hook is called on exit and the sys.excepthook - is called when an exception occur. - - A CPython compatible xreadlines module. - - Support for os.environ and os.system() on common platforms. - - Includes zxJDBC for Python DB API 2.0 compatibility. - - Bug fixes. - - [ #438297 ] SimpleHTTPServer does not work - - [ #440660 ] using nested java cls @ level >2 fails - - [ #448485 ] Tuple unpacking raises KeyError - - [ #448523 ] Support "ASCII" as builtin codec. - - [ #449316 ] ArrayList()[0] should raise IndexError - - [ #449956 ] jythonc 2.1a3 --package problem - - [ #450938 ] time module requires JDK 1.4 - - [ #451746 ] jythonc --deep pjy$packages problem - - [ #452526 ] traceback lineno is the except line - - [ #452947 ] Class of innerclass inst <> innerclas - - [ #453301 ] jythonc --compileropts on Windows - - [ #457614 ] pls change ©right; to (c) in sources - - [ #458945 ] Missing 'lastindex' on match objects - - [ #462280 ] builtin method as a class variable - - [ #467826 ] SHA digest() method doesn't work - - [ #473676 ] cStringIO bug - - [ #475445 ] incompatibility with python - - [ #475666 ] __nonzero__ exceptions must be ignored - - [ #476580 ] 'del obj.non_member' : wrong exception - - [ #476772 ] shutdowns in jython / atexit - - [ #477608 ] os.path.getmtime() missing - - [ #477768 ] ord([123]) 21a3 - - [ #477793 ] os.utime() is missing. - - [ #480373 ] Can't find _PyInner with classloader. - - [ #480390 ] main() does not throw exceptions - - [ #484181 ] command line args in dos - - [ #485558 ] Synchronization bug in sys.initialize. - - [ #485968 ] cStringIO.softspace is not assignable. - -29-jul-2001 Jython 2.1 alpha 3 - - New features. - - A settable console encoding will allow windows users to enter - national characters at the command prompt. - - Non-public classes are available when respectJavaAccessibility is false - - The names of zip- and jarfiles can be added to sys.path. - - Bug fixes. - - The standard python library files are from CPython-2.1.1 - - A complete list of fixed bugs can be found on SF: - http://sourceforge.net/tracker/?group_id=12867&atid=112867 - Select Status=Any and Group=Fixed in 2.1a3 - -18-jul-2001 Jython 2.1 alpha 2 - - New features. - - Added ReadlineConsole class. This class will make it a lot easier - to integrate Bablok's readline support. - - Display Hook for Interactive Use (pep-0217) - - Added zlib, gzip and zipfile modules. - - Added nested scope to jythonc (pep-0227). - - Bug fixes. - - Fixed obscure __import__ error message #437800 - - Prevent a NPE during import when running with a security manager - - Fixed multi-level Java method overriding #222819. - - Fix for dependency problem with jythonc. #415933 - - Fix a lost syntax error when auto importing submodules. - - Use quotes around classpath, but only for win+jdk1.1. - - Find the complete list of fixed bug on SF: - http://sourceforge.net/tracker/?group_id=12867&atid=112867 - Select Status=Any and Group=Fixed in 2.1a2 - - -14-mar-2001 Jython 2.1 alpha 1 - - New features. - - Improve speed when indexing a string and iterating over a string - in a for loop. - - Reworked coercing model (pep-0208) - - Added {}.popitem(). - - Improved speed for python files by buffering the RandomAccessFile. - - Added function attributes (pep-0232) - - Rich comparison (pep-0207) - - Updated cPickle to handle CPython compatible unicode strings. - - Updated sre to CPython-2.1a1 - - Added the "new" module - - Added a PyServlet class to the util package. - - Warning framework (pep-0230). - - Added sys.add_classdir and sys.add_extdir. - - Added nested scope to the interpreter (pep-0227). - - Bug fixes. - - Allow self referencing adapters to be collected when using weak - tables. - - Added workaround for a reader bug in MRJ22Jitc.01. - - Fixes #127340 where serializable parameter received a PyObject - instead of the wrapped java object. - - Include a LineNumberTable in the compiled class files. - - Fixed a java version test bug in the installer. - - Added workaround for class initialization bug in MRJ2.2.4 - - Added support for three argument getattr() calls. - -17-Jan-2001 Jython 2.0 final release - - Bug fixes. - - Install the correct image for the local documention. - - Added os.linesep field. - -15-Jan-2001 Jython 2.0 release candidate 1 - - New features - - Experimental support for reloading java packages. Thanks to - Samuele Pedroni for all his work on the Jython/Java integration. - - Bug fixes. - - Prevent a NPE when a .jar on the classpath is corrupt. Instead - a message with the original IOException is printed. - -10-Jan-2001 Jython 2.0 beta 2 - - New features - - Added socket.getfqdn(). Thanks to Brian Zimmer for the patch. - - Bug fixes. - - Fixed innerclass names with '$' #127200 - - Fixed a bug where final methods were overriden in proxy #127201. - - Fixed a bug in exec which allow a fileobject to be passed in. - Thanks to Brian Zimmer for the patch. - -31-Dec-2000 Jython 2.0 beta 1 - - New features - - Installer logo by Ivan Kougaenko. The logo content is still - open, so submit you suggestions. - - The default packages selected in the installer are now better - attuned to the normal user (as opposed to the jython devers). - - Bug fixes. - - Fixed a NPE when a class is defined in non-module namespace. - - Fixed a compilation problem when using JDK1.2.x - - The installer now creates a useable Uninstall.class. - -25-Dec-2000 Jython 2.0 alpha 3 - - Bug fixes. - - Fixed a bug that caused Infinite recursion in subpackage - import - - Fixed conversion error when a long is converted to a java double. - - Fixed a bug where an attribute in a package __init__.py would - hide a submodule. - - Fixed missing quotes around the path to java.exe in jython.bat - for windows. - - Include missing re.py in installer. - - Added threading and atexit modules from CPython2.0. - -17-Dec-2000 Jython 2.0 alpha 2 - - New features. - - Added -v (verbose) option to jython command. It will trace - import statements. Use three -v's for maximum information. - - Added new registry option python.options.internalTablesImpl - which is a list of choices (':' separated) for internal - tables implementations. These tables contain the mapping of - classes to PyJavaClasses. - Long running applications that unloads classes can avoid a - memory leak by setting the property to "weak" or "soft". - That will use a table implementation which use weak or soft - refrences. - - Use a SecureClassLoader for loading compiled python modules. - This should allow jython to be used with the java plugin and - its fine grained security. - - CPython-2.0 compatibility - - Added support for formatting of long values in "%d %x %X %o". - The support does not match CPython2.0 exactly, but matches - what CPython2.1 will do. - - The \x escape will only eat two hex characters and will - always create a character with values < 256. Use the \u - escape for high-byte values. - - A ucnhash module to support the \n{name} escape. - - Backward incompatibility: - - The python.path property is appended to sys.path instead of - being inserted at position 1 in sys.path. - - Bug fixes. - - Package relative import works in jythonc, at least when the dotted - package name match the directory structure. - - Fixed oct(0) to return "0" - - Added a os.__file__ attribute. CPython's site.py expects that. - - Fixed a exception when calling int("0", 16) - - Delay closing a socket until all sock.makefile() files are closed. - - Avoided a duplicate call to Class.getMethods(). This will improve - performance. - - Allow from import * to modify the locals in a function (bug 122834). - - Classes with the same name do no longer clash (bug 122820). - - Avoid a memory leak where many threads get started and stopped. The - fix only works on java2. - -26-Nov-2000 Jython 2.0 alpha 1 - - New features. - - Integrate the free ORO regular expression matcher from the apache - project. - - CPython2.0 compatibility, including - - List comprehension. - - Extended call syntax. - - Extended print statement - - Augmented assignment. - - Unicode support libraries and codecs. - - sre unicode regular expression. - - Some backward incompatibility is introduced: - - The user configuration file is now called <user.home>/.jython - - Text files will pass data read and written through the default - codecs for the JVM. Binary files will write only the lower eight - bits of each unicode character. - - arrays passed to java code will no longer autocoerce just - because the elements can be autocoerced. - - The precedence of java loading have changed. Now the sys.path - is searched for python modules before the CLASSPATH and sys.path - is searched for java class and java packages. - - The builtin exceptions are always classbased. -X is disable. - User exception can still be strings. - - Bug fixes. - - Many, including the errata. - - Now the content of a java package is the union of the content of all - locations with the corresponding valid hierarchical name - from dirs and jars of CLASSPATH (and sys.path for dirs); i.e. - from jpkg import * works for jpkg in a dir too. - - Improved CPython 2.0 compatibility - - codecs module - - sha module. - -26-Jan-2000 JPython 1.1 final released - - - Only one small CPython compatibility patch to os.mkdir() and - os.makedirs() -- optional `mode' argument, which is ignored. - -21-Jan-2000 JPython 1.1 release candidate 1 released - - New JPython features and bug fixes - - Race conditions when creating multiple PythonInterpreter objects - in an embedded multithreaded Java application have been fixed. - - Recursive print of a module's namespace no longer overflows the - JVM stack. - - Fixed backslashing of quotes inside triple quoted strings (Finn - Bock). - - Fixes to read(int) method on file objects, which used to return - the empty string before EOF was seen. - - Class-based exceptions are used in frozen (jpythonc) modules. - - Duplicate argument names in a function definition raise the - appropriate SyntaxError. - - os.path.getsize() has been added. - - mutability of tuples under some situations has been fixed. - - dictionary insertion order affecting dictionary equality has - been fixed (Finn Bock). - - Using the --package option with jpythonc has been fixed. - - Improved CPython 1.5.2 compatibility - - optional sizehint argument implemented for readlines() method on - file objects. - - Better compatibility in %g formatting of floats. - - sys.stdout.softspace is now writeable. - - re.VERBOSE/re.X flags are implemented. - - traceback object's reprs are CPython conformant. - - In module os, os.error is equivalent to the builtin OSError. - Also, listdir(), mkdir(), makedirs(), remove(), rename(), and - rmdir() raise OSError directly. - - os.stat() raises an OSError if the file is missing. - -28-Oct-1999 JPython 1.1beta4 released - - New JPython features and bug fixes - - fixed a bug related to loading anonymous inner classes (PR#201). - This is an experimental patch. See registry file for entry - python.options.extendedClassLoader - - fixed Java exceptions when calling apply() with a bogus 3rd - argument (PR#208) - - fixed a 1.1beta3 problem with method objects having their - im_self mysteriously changed out from under them (PR#186). - - fixed problems with Python classes being deeply derived from - Java classes and interfaces (PR#178, PR#195). - - Improved memory footprint when using exec(). - - Dead threads are now reaped from thread state cache (Drew - Morrissey). - - Tuples, dictionaries, and strings now use fast method lookup - mechanism. - - Improved CPython 1.5.2 compatibility - - md5 module supported (no need to download anything extra) - - dir() on function objects now returns a list containing __doc__, - func_doc, __namme__, func_name, func_globals, func_defaults, - func_code. __doc__/func_doc is writable (but not func_defaults - and func_code, which are writable in CPython). (PR#192) - - dir() on code objects returns a list containing co_name, - co_argcount, co_varnames, co_filename, co_firstlineno, co_flags. - Not supported: co_nlocals, co_code, co_consts, co_names, - co_lnotab, co_stacksize. All attributes are read-only. - - dir() on method objects returns a list containing im_self, - im_func, im_class, __doc__, __name__. These attributes are - read-only. - -22-Sep-1999 JPython 1.1beta3 released - - New JPython features and bug fixes - - - JPython can now optionally access non-public members of Java - classes. By setting the registry entry - python.security.respectJavaAccessibility=false, JPython can - access private, package-private, and protected fields, methods, - and constructors. By default, normal Java access rules are - followed, i.e. only public members can be accessed. This - feature only works if running with Java 1.2. Thanks to Tony - Plate for his initial implementation. - - A new framework for looking up the methods for builtin types has - been enabled. This can speed up method calls by a factor of 2. - The feature is currently experimental and has only been - implemented for list objects, but will be implemented for other - builtin objects for the next release. - - Some workarounds for weird JIT bugs have been added, but this - may not fix all problems related to running JPython under JVMs - with JIT enabled. - - A wrapper for a free md5 builtin module is included, although - the md5 implementation is not. See the comment in - org/python/modules/MD5Module.java for details. - - New semantics for registry key python.modules.builtin (and - correspondingly the org/python/modules/Setup.java file). - - Improved CPython 1.5.2 compatibility - - - sys.modules['__builtin__'] and "import __builtin__" has been - fixed. - - Builtin methods and functions now have the standard __name__, - __doc__, __self__, and __members__ attributes. - - Dictionaries and lists now have a __methods__ attribute, and - dir({}) or dir([]) return the list of members. - - repr(8to16bitstring) now prints standard octal escapes for 8bit - characters. It still prints hex escapes for 16bit characters. - - Added abspath() to os.path (i.e. javapath) - - Code objects now have a co_flags attribute - - Frame objects now have f_trace attribute, and dir(frame) works - - None() now raises a TypeError - - tuple(somelist) immutability patch - - re match objects now have groupdict() method - - Finn Bock patch for setting of a module's __name__ after reload - -16-Jun-1999 JPython 1.1beta2 released - - - Updates and bug fixes to jpythonc tool. New registry entries - python.jpythonc.compiler, python.jpythonc.classpath, and - python.jpythonc.compileropts. getopt style long/short option - names (old options are deprecated). New -J/--compileropts - option. - - syncing string object methods with experimental CPython 1.6 - string methods. This includes new optional arguments on - startswith() and endswith() and the moving of join() to a method - of the separator string. - - Many other bug fixes and CPython syncs - -04-Jun-1999 JPython 1.1beta1 released - - Highlights of changes since JPython 1.0.3 - - - New and improved jpythonc tool by Jim Hugunin - - New modules contributed by Finn Bock: cStringIO, cPickle, - struct, binascii - - New module synchronize, equivalent to Java's synchronized - keyword - - Operator module now complete - - sys.add_package() no longer necessary, "import java.lang" just works - - Class-based standard exceptions (w/ support for -X option) - - super__ methods are deprecated, use regular Python style - - time.strftime() added - - Java 1.2 style collections support - - Multiple interpreter states - - Most CPython 1.5.2 features have been implemented - - String objects now have methods -- expected CPython 1.6 feature - - Improved performance - - Java inner class support - - keywords are allowed in some locations (e.g. as attribute names) - - New license - - bug fixes - - - - -Local Variables: -mode: indented-text -indent-tabs-mode: nil -End: Copied: branches/Release_2_2maint/jython/NEWS (from rev 3421, branches/Release_2_2maint/NEWS) =================================================================== --- branches/Release_2_2maint/jython/NEWS (rev 0) +++ branches/Release_2_2maint/jython/NEWS 2007-08-20 06:16:55 UTC (rev 3422) @@ -0,0 +1,657 @@ +Jython NEWS + +Jython 2.2 rc3 + New Features + - Added telnetlib from CPython + - Added cpython_compatible_select to select. See + http://wiki.python.org/jython/SelectModule for information on when + to use it. + - Several more java.nio exceptions are mapped to their corresponding + Python error codes when thrown. + Bugs fixed + - recv on closed sockets threw an exception instead returning the + empty string + - A PySystemState being garbage collected caused System.out and + System.in to be closed. This would cause 'print' to stop working. + - Closing a FileWrapper on a socket closes its underlying socket + - Sockets just have their [In|Out]putStreams closed instead of being + properly shutdown by shutdown() + - SO_REUSEADDR is reset on sockets from a server socket's accept call + causing later binds to the server socket's port to fail. + - Client sockets that have bind called before connect don't respect + SO_REUSEADDR + - [ 1758838 ] execfile() throws a NullPointerException in the interactive + console + +Jython 2.2 rc2 + Bugs fixed + - [ 931129 ] jython -jar some-path/test.jar fails + - [ 1719528 ] -c doesn't put the empty string in sys.path + - [ 1746957 ] Weird 'uu' prefix for unicode + - [ 1747092 ] Failed imports should not be "cached" + - [ 1742770 ] urllib.urlopen('http://inv') -> UnknownHostException + - [ 1745068 ] select gives confusing message when given blocking sockets + - [ 1744775 ] umlauts displayed incorrectly in installer + - timeouts on socket client connects were not being honoured + - a float could not be passed as milliseconds to select.poll.poll + +Jython 2.2 rc1 + New features + - Completely rewritten socket module and new select module using java.nio + which allows the use of SSL and non-blocking sockets. + - Explicit imports of Java classes like 'from java.net import URL' or + 'import java.net.URL' work with package scanning disabled. + Bugs fixed + - [ 1708080 ] float("1d") -> 1.0 (not ValueError as expected) + - [ 1661700 ] os.path.abspath raises IOException if drive not accessible + - [ 1662689 ] os.path.abspath eliminates symlinks + - [ 1717498 ] os.path.splitdrive does nothing for Windows drives + - [ 1622207 ] _weakref.ref(o) only works if the argument is hasheable + - [ 1735864 ] Parser not threadsafe + - [ 1722306 ] OverflowError in UDP Socket Implementation + - [ 1348645 ] socket.py send() requires too many arguments + - [ 998602 ] urllib : https request does not work + - [ 621180 ] module socket _udpsocket close bug + +Jython 2.2 beta2 + New features + - All functions in __builtin__ are new style functions instead of reflected + functions + - Classmethods added to newstyle classes + - array is a newstyle class + - org.python.util.JLineConsole provides readline-like functionality with + JLine without requiring native readline + + Bugs fixed + - [ 1599012 ] current directory is prepended to entries in sys.path + - [ 1654484 ] Initializing PyJavaClass for java.lang.OutOfMemory causes a further OutOfMemory problem + - [ 1661679 ] types.UnicodeType is str + - [ 1659819 ] Joining unicode items with string doesn't create unicode + - [ 1603253 ] Thread's setDaemon setting does not work + - types module uses newstyle classes + - [ 1671134 ] '%s' % u'x' returns str object + - [ 1672800 ] __import__('module', None) raises AttributeError + - [ 1576036 ] Fix: SyspathJavaLoader file reader causes importerror + - [ 1605847 ] co_filename set in bytecode doesn't match __file__ + - [ 1603312 ] subclasses of int raise a TypeError when given large value + - [ 1603315 ] str missing object keyword arg + - [ 1603747 ] Multiple InteractiveInterpreter share same setErr/Out + - [ 1619040 ] dict.fromkeys() should take iterable + - [ 1658647 ] type(x) calls x.__class__.__init__ + - [ 1699556 ] SAXException descends from Java's Exception instead of Python's + - [ 1603686 ] Unmarshaling long-error + - [ 1230674 ] eval with from future does not work through import + - [ 663592 ] Problems calling an overriden class in the constructor + - [ 448398 ] open('test.txt', 'w').write('test') fails + - [ 1671373 ] A "$_PyInner.class" file in a package causes import to fail + - [ 1671431 ] dir function does not work with database connection object + - [ 1713513 ] os.environ fails in Windows Vista JDK 1.6_01 + Patches applied + - [ 1681774 ] str.decode, unicode.encode and str(u'') fixes + - [ 1682423 ] Convert PyModule to a new-style class + - [ 1682498 ] Fix int(None) raising an AttributeError + - [ 1684172 ] Changes to make compileall work + - [ 1628469 ] fixes for failing builtin tests + + +Jython 2.2 beta1 + New features + - much improved support for __unicode__ especially in the parser (u"string" and + friends now result in a PyUnicode object) + - added datetime support using the pure python datetime.py from cpython non-dist. + - new-style classes and their instances are Java serializable + - most new-style builtin types can be pickleds + - __slots__ for new-style classes + - xml modules from pyxml readded + - comparison operations between subclasses of + builtin types tries the subclass first even if it's on the right side + Bugs fixed. + - Modules that throw exceptions while being imported aren't left + in sys.modules + - Don't allow sys.recursionlimit to be set below 0 + - [ 1533624 ] NPE thrown building traceback for a call that jumps + threads + - [ 1531644 ] import * makes java exception uncatchable + - [1243049, 1218089] Can't subclass builtin types in 2.2a1 + - [1256506] Importing directory module with 12+ char name fails + - [1512745] Allow arbitrary precision for formatted strings, + but only 250 chars for decimal, integer and long + - [1506749] Instance __dict__ are unassignable + - [1599004] several fixes to get the sha module up to speed + - [1616493] unicode objects can't be passed to os.path + methods + - [ 979157 ] Stack traces untrimmed + - [ 1299032 ] os.getenv out of sync with cpython + - [ 738951 ] jython slice behavior differs from python in __getattr__ + - [ 610576 ] Impl of abstract method not found + - [ 1374088 ] keyword args to dict() constructor ignored + - [ 730082 ] new can't create unbound methods + - [ 1382581 ] double(s) read inaccurately from database + - [ 1603312 ] subclasses of int raise a TypeError when given large + value + - [1465476] bad parenthesis nesting terminates interpreter + - [ 1227282 ] Deadlock between PythonTraceFunction.safeCall() and + imp.import + - [ 1421812 ] Jython 2.2a and 2.1 imports directories as modules + - [ 480017 ] Proxy super classes are loaded from syspath, not the + proxy's classpath + - [ 628315 ] problem with Java synchronized lists + - [ 1284344 ] __file__ compiled into .py.class file + - [ 610576 ] Impl of abstract method not found + Patches applied. + - [906256] Follow spec for read modes of open() + - [868514] yield in finally block -- yield in nested try:except: + - [1542997] Only evaluate the second expression in an assert + if the first expression is false + - [1612711]: add iterkeys, itervalues and iteritems to + PyStringMap + - [ 1267425 ] make cStringIO work with gzip.py + - [ 1361317 ] __set__ failing on PyProperty + + +17-jul-2005 Jython 2.2 alpha1 + + New features + - Integrated patch (by Aleks Totic) that allows to use the Python parser + outside of Jython. PythonGrammar grows two constructors, one of which + _must_ be used: + PythonGrammar(CharStream stream,IParserHost host) + PythonGrammar(PythonGrammarTokenManager tm, IParserHost host) + They both takes an impl of org.python.parser.IParserHost to which + literal building is delegated. org.python.core.parser contains the + source of the impl used by Jython. + - New-style classes + - PEP 302 implementation + - Java collections integration + - finished long/int unification -- PyObject.__int__() now returns a + PyObject (which could be a PyInteger or a PyLong). + - dict and list conform to CPython 2.3 behaviors (such as the 3 arg + list.index()). + - new-style conversion of tuple, float, file and str. + - Preliminary work on a unicode type. + - Imported tempfile.py and userlist.py from CPython 2.3 and applied some + small adjustments to get tests to pass. + - Reworked message construction for TypeError exceptions + (such as the exceptions generated from operations like [] + ""). + +31-jul-2003 Jython 2.2 alpha0 + + New features + - Iterators (pep-234). + - Changing the Division Operator (pep-238) + - Implemented a new compiler AST. + - Quitting (Ctrl-Z/D) Jython in interactive mode will force the running JVM + to exit, even if there are non-daemon threads (e.g. AWT), this is likely + the expected behavior. The behavior for (non-interactive) scripts is + unchanged and still matches that of Java programs. + - OutOfMemoryError can be caught, also matching MemoryError, that means + that a caught PyException.value.__tojava__(Throwable.class) + can potentially be a OutOfMemoryError instance. This is different from + the old aborting behavior (System.exit was called) [change needed to pass + a test in CPython test_b1]. + + Bug fixes. + - Renamed the use of the java1.4 reserved words 'assert'. + - [ #222805 ] multi-line statements in the JPython interpreter + - [ #495866 ] need dynamic scale for BigDecimal + - [ #499973 ] isql.Prompt can't be written to stdout. + - [ #508111 ] jythonc generates invalid statements + - [ #511493 ] jreload truncates large class files + - [ #515894 ] Behaviour of "+=" stm. is different from + - [ #517237 ] Binary ops with int and long fail + - [ #521704 ] no errno module + - [ #522423 ] cStringIO has no reset() method + - [ #522558 ] list() is broken + - [ #522828 ] struct.pack('>NNs', v) fails for NN > 20 + - [ #529242 ] Python singletons deserialization bug + - [ #532747 ] for i in iter(d) + - [ #533354 ] bug in xml.dom.minidom.parseString + - [ #533541 ] send() on _udpsocket fails + - [ #544891 ] problems with socket.py + - [ #545235 ] unexpected match with re + - [ #549107 ] .__doc__ doesn't work in jython + - [ #562943 ] os.path.getmtime misbehaves on nonfile + - [ #567844 ] list() does not make a shallow copy + - [ #572769 ] Blank input lines break readline console + - [ #573784 ] popen does not work + - [ #573791 ] os.system partly broken + - [ #575110 ] Multiple for's on Collection broken + - [ #577395 ] Outer finally not executed at return + - [ #581785 ] bug in 4DOM + - [ #582618 ] Case insensitive re.match fails + - [ #608628 ] long(java.math.BigInteger) does not work + - [ #609505 ] SQLWarning tuples not populated + - [ #620978 ] Variable default for Options.caseok + - [ #625364 ] sys.last_traceback not set? + - [ #631017 ] Private fields mismangled + - [ #631035 ] Negative repeat cause java exception. + - [ #631430 ] read(-1) uses wrong fileposition. + - [ #636381 ] Match Error for +? pattern element + - [ #654863 ] string.split behaves differently + - [ #668194 ] broken non greedy regular expressions + +31-dec-2001 Jython 2.1 final + + Bug fixes. + - [ #493359 ] Installer should include <EXIT> button + - [ #495602 ] os.path.dirname() can result in an NPE + - [ #495604 ] imp.find_module fails when None is 2 arg + +21-dec-2001 Jython 2.1 beta 2 + + New features. + - support for callproc() in zxJDBC is now available for most simple + stored procedure calls. + + Bug fixes. + - [ #451552 ] case insensitivity on import causes prob + - [ #456926 ] PackageManager doesn't work correctly + - [ #484949 ] __import__(_) does unwanted rel search + - [ #488632 ] -c sys.argv diff + - [ #489168 ] Parse error, java traceback + - [ #489836 ] Private names is not mangled + - [ #490157 ] string.splitlines() - incorrectly splits + - [ #490230 ] NotImplemented not implemented + - [ #490961 ] PyFile.java requires JDK 1.2 + - [ #490962 ] Typo in PyFile.java + - [ #490963 ] Please update ReadlineConsole.java + - [ #494514 ] Python object not gc()'d + - [ #495458 ] multi level import from .zip file. + - [ #495870 ] zxJDBC now only prepares statements with params. + +03-dec-2001 Jython 2.1 beta 1 + + New features. + - The weakref module is now available. + - The sys.exitfunc hook is called on exit and the sys.excepthook + is called when an exception occur. + - A CPython compatible xreadlines module. + - Support for os.environ and os.system() on common platforms. + - Includes zxJDBC for Python DB API 2.0 compatibility. + + Bug fixes. + - [ #438297 ] SimpleHTTPServer does not work + - [ #440660 ] using nested java cls @ level >2 fails + - [ #448485 ] Tuple unpacking raises KeyError + - [ #448523 ] Support "ASCII" as builtin codec. + - [ #449316 ] ArrayList()[0] should raise IndexError + - [ #449956 ] jythonc 2.1a3 --package problem + - [ #450938 ] time module requires JDK 1.4 + - [ #451746 ] jythonc --deep pjy$packages problem + - [ #452526 ] traceback lineno is the except line + - [ #452947 ] Class of innerclass inst <> innerclas + - [ #453301 ] jythonc --compileropts on Windows + - [ #457614 ] pls change ©right; to (c) in sources + - [ #458945 ] Missing 'lastindex' on match objects + - [ #462280 ] builtin method as a class variable + - [ #467826 ] SHA digest() method doesn't work + - [ #473676 ] cStringIO bug + - [ #475445 ] incompatibility with python + - [ #475666 ] __nonzero__ exceptions must be ignored + - [ #476580 ] 'del obj.non_member' : wrong exception + - [ #476772 ] shutdowns in jython / atexit + - [ #477608 ] os.path.getmtime() missing + - [ #477768 ] ord([123]) 21a3 + - [ #477793 ] os.utime() is missing. + - [ #480373 ] Can't find _PyInner with classloader. + - [ #480390 ] main() does not throw exceptions + - [ #484181 ] command line args in dos + - [ #485558 ] Synchronization bug in sys.initialize. + - [ #485968 ] cStringIO.softspace is not assignable. + +29-jul-2001 Jython 2.1 alpha 3 + + New features. + - A settable console encoding will allow windows users to enter + national characters at the command prompt. + - Non-public classes are available when respectJavaAccessibility is false + - The names of zip- and jarfiles can be added to sys.path. + + Bug fixes. + - The standard python library files are from CPython-2.1.1 + - A complete list of fixed bugs can be found on SF: + http://sourceforge.net/tracker/?group_id=12867&atid=112867 + Select Status=Any and Group=Fixed in 2.1a3 + +18-jul-2001 Jython 2.1 alpha 2 + + New features. + - Added ReadlineConsole class. This class will make it a lot easier + to integrate Bablok's readline support. + - Display Hook for Interactive Use (pep-0217) + - Added zlib, gzip and zipfile modules. + - Added nested scope to jythonc (pep-0227). + + Bug fixes. + - Fixed obscure __import__ error message #437800 + - Prevent a NPE during import when running with a security manager + - Fixed multi-level Java method overriding #222819. + - Fix for dependency problem with jythonc. #415933 + - Fix a lost syntax error when auto importing submodules. + - Use quotes around classpath, but only for win+jdk1.1. + - Find the complete list of fixed bug on SF: + http://sourceforge.net/tracker/?group_id=12867&atid=112867 + Select Status=Any and Group=Fixed in 2.1a2 + + +14-mar-2001 Jython 2.1 alpha 1 + + New features. + - Improve speed when indexing a string and iterating over a string + in a for loop. + - Reworked coercing model (pep-0208) + - Added {}.popitem(). + - Improved speed for python files by buffering the RandomAccessFile. + - Added function attributes (pep-0232) + - Rich comparison (pep-0207) + - Updated cPickle to handle CPython compatible unicode strings. + - Updated sre to CPython-2.1a1 + - Added the "new" module + - Added a PyServlet class to the util package. + - Warning framework (pep-0230). + - Added sys.add_classdir and sys.add_extdir. + - Added nested scope to the interpreter (pep-0227). + + Bug fixes. + - Allow self referencing adapters to be collected when using weak + tables. + - Added workaround for a reader bug in MRJ22Jitc.01. + - Fixes #127340 where serializable parameter received a PyObject + instead of the wrapped java object. + - Include a LineNumberTable in the compiled class files. + - Fixed a java version test bug in the installer. + - Added workaround for class initialization bug in MRJ2.2.4 + - Added support for three argument getattr() calls. + +17-Jan-2001 Jython 2.0 final release + + Bug fixes. + - Install the correct image for the local documention. + - Added os.linesep field. + +15-Jan-2001 Jython 2.0 release candidate 1 + + New features + - Experimental support for reloading java packages. Thanks to + Samuele Pedroni for all his work on the Jython/Java integration. + + Bug fixes. + - Prevent a NPE when a .jar on the classpath is corrupt. Instead + a message with the original IOException is printed. + +10-Jan-2001 Jython 2.0 beta 2 + + New features + - Added socket.getfqdn(). Thanks to Brian Zimmer for the patch. + + Bug fixes. + - Fixed innerclass names with '$' #127200 + - Fixed a bug where final methods were overriden in proxy #127201. + - Fixed a bug in exec which allow a fileobject to be passed in. + Thanks to Brian Zimmer for the patch. + +31-Dec-2000 Jython 2.0 beta 1 + + New features + - Installer logo by Ivan Kougaenko. The logo content is still + open, so submit you suggestions. + - The default packages selected in the installer are now better + attuned to the normal user (as opposed to the jython devers). + + Bug fixes. + - Fixed a NPE when a class is defined in non-module namespace. + - Fixed a compilation problem when using JDK1.2.x + - The installer now creates a useable Uninstall.class. + +25-Dec-2000 Jython 2.0 alpha 3 + + Bug fixes. + - Fixed a bug that caused Infinite recursion in subpackage + import + - Fixed conversion error when a long is converted to a java double. + - Fixed a bug where an attribute in a package __init__.py would + hide a submodule. + - Fixed missing quotes around the path to java.exe in jython.bat + for windows. + - Include missing re.py in installer. + - Added threading and atexit modules from CPython2.0. + +17-Dec-2000 Jython 2.0 alpha 2 + + New features. + - Added -v (verbose) option to jython command. It will trace + import statements. Use three -v's for maximum information. + - Added new registry option python.options.internalTablesImpl + which is a list of choices (':' separated) for internal + tables implementations. These tables contain the mapping of + classes to PyJavaClasses. + Long running applications that unloads classes can avoid a + memory leak by setting the property to "weak" or "soft". + That will use a table implementation which use weak or soft + refrences. + - Use a SecureClassLoader for loading compiled python modules. + This should allow jython to be used with the java plugin and + its fine grained security. + + CPython-2.0 compatibility + - Added support for formatting of long values in "%d %x %X %o". + The support does not match CPython2.0 exactly, but matches + what CPython2.1 will do. + - The \x escape will only eat two hex characters and will + always create a character with values < 256. Use the \u + escape for high-byte values. + - A ucnhash module to support the \n{name} escape. + + Backward incompatibility: + - The python.path property is appended to sys.path instead of + being inserted at position 1 in sys.path. + + Bug fixes. + - Package relative import works in jythonc, at least when the dotted + package name match the directory structure. + - Fixed oct(0) to return "0" + - Added a os.__file__ attribute. CPython's site.py expects that. + - Fixed a exception when calling int("0", 16) + - Delay closing a socket until all sock.makefile() files are closed. + - Avoided a duplicate call to Class.getMethods(). This will improve + performance. + - Allow from import * to modify the locals in a function (bug 122834). + - Classes with the same name do no longer clash (bug 122820). + - Avoid a memory leak where many threads get started and stopped. The + fix only works on java2. + +26-Nov-2000 Jython 2.0 alpha 1 + + New features. + - Integrate the free ORO regular expression matcher from the apache + project. + + CPython2.0 compatibility, including + - List comprehension. + - Extended call syntax. + - Extended print statement + - Augmented assignment. + - Unicode support libraries and codecs. + - sre unicode regular expression. + + Some backward incompatibility is introduced: + - The user configuration file is now called <user.home>/.jython + - Text files will pass data read and written through the default + codecs for the JVM. Binary files will write only the lower eight + bits of each unicode character. + - arrays passed to java code will no longer autocoerce just + because the elements can be autocoerced. + - The precedence of java loading have changed. Now the sys.path + is searched for python modules before the CLASSPATH and sys.path + is searched for java class and java packages. + - The builtin exceptions are always classbased. -X is disable. + User exception can still be strings. + + Bug fixes. + - Many, including the errata. + - Now the content of a java package is the union of the content of all + locations with the corresponding valid hierarchical name + from dirs and jars of CLASSPATH (and sys.path for dirs); i.e. + from jpkg import * works for jpkg in a dir too. + + Improved CPython 2.0 compatibility + - codecs module + - sha module. + +26-Jan-2000 JPython 1.1 final released + + - Only one small CPython compatibility patch to os.mkdir() and + os.makedirs() -- optional `mode' argument, which is ignored. + +21-Jan-2000 JPython 1.1 release candidate 1 released + + New JPython features and bug fixes + - Race conditions when creating multiple PythonInterpreter objects + in an embedded multithreaded Java application have been fixed. + - Recursive print of a module's namespace no longer overflows the + JVM stack. + - Fixed backslashing of quotes inside triple quoted strings (Finn + Bock). + - Fixes to read(int) method on file objects, which used to return + the empty string before EOF was seen. + - Class-based exceptions are used in frozen (jpythonc) modules. + - Duplicate argument names in a function definition raise the + appropriate SyntaxError. + - os.path.getsize() has been added. + - mutability of tuples under some situations has been fixed. + - dictionary insertion order affecting dictionary equality has + been fixed (Finn Bock). + - Using the --package option with jpythonc has been fixed. + + Improved CPython 1.5.2 compatibility + - optional sizehint argument implemented for readlines() method on + file objects. + - Better compatibility in %g formatting of floats. + - sys.stdout.softspace is now writeable. + - re.VERBOSE/re.X flags are implemented. + - traceback object's reprs are CPython conformant. + - In module os, os.error is equivalent to the builtin OSError. + Also, listdir(), mkdir(), makedirs(), remove(), rename(), and + rmdir() raise OSError directly. + - os.stat() raises an OSError if the file is missing. + +28-Oct-1999 JPython 1.1beta4 released + + New JPython features and bug fixes + - fixed a bug related to loading anonymous inner classes (PR#201). + This is an experimental patch. See registry file for entry + python.options.extendedClassLoader + - fixed Java exceptions when calling apply() with a bogus 3rd + argument (PR#208) + - fixed a 1.1beta3 problem with method objects having their + im_self mysteriously changed out from under them (PR#186). + - fixed problems with Python classes being deeply derived from + Java classes and interfaces (PR#178, PR#195). + - Improved memory footprint when using exec(). + - Dead threads are now reaped from thread state cache (Drew + Morrissey). + - Tuples, dictionaries, and strings now use fast method lookup + mechanism. + + Improved CPython 1.5.2 compatibility + - md5 module supported (no need to download anything extra) + - dir() on function objects now returns a list containing __doc__, + func_doc, __namme__, func_name, func_globals, func_defaults, + func_code. __doc__/func_doc is writable (but not func_defaults + and func_code, which are writable in CPython). (PR#192) + - dir() on code objects returns a list containing co_name, + co_argcount, co_varnames, co_filename, co_firstlineno, co_flags. + Not supported: co_nlocals, co_code, co_consts, co_names, + co_lnotab, co_stacksize. All attributes are read-only. + - dir() on method objects returns a list containing im_self, + im_func, im_class, __doc__, __name__. These attributes are + read-only. + +22-Sep-1999 JPython 1.1beta3 released + + New JPython features and bug fixes + + - JPython can now optionally access non-public members of Java + classes. By setting the registry entry + python.security.respectJavaAccessibility=false, JPython can + access private, package-private, and protected fields, methods, + and constructors. By default, normal Java access rules are + followed, i.e. only public members can be accessed. This + feature only works if running with Java 1.2. Thanks to Tony + Plate for his initial implementation. + - A new framework for looking up the methods for builtin types has + been enabled. This can speed up method calls by a factor of 2. + The feature is currently experimental and has only been + implemented for list objects, but will be implemented for other + builtin objects for the next release. + - Some workarounds for weird JIT bugs have been added, but this + may not fix all problems related to running JPython under JVMs + with JIT enabled. + - A wrapper for a free md5 builtin module is included, although + the md5 implementation is not. See the comment in + org/python/modules/MD5Module.java for details. + - New semantics for registry key python.modules.builtin (and + correspondingly the org/python/modules/Setup.java file). + + Improved CPython 1.5.2 compatibility + + - sys.modules['__builtin__'] and "import __builtin__" has been + fixed. + - Builtin methods and functions now have the standard __name__, + __doc__, __self__, and __members__ attributes. + - Dictionaries and lists now have a __methods__ attribute, and + dir({}) or dir([]) return the list of members. + - repr(8to16bitstring) now prints standard octal escapes for 8bit + characters. It still prints hex escapes for 16bit characters. + - Added abspath() to os.path (i.e. javapath) + - Code objects now have a co_flags attribute + - Frame objects now have f_trace attribute, and dir(frame) works + - None() now raises a TypeError + - tuple(somelist) immutability patch + - re match objects now have groupdict() method + - Finn Bock patch for setting of a module's __name__ after reload + +16-Jun-1999 JPython 1.1beta2 released + + - Updates and bug fixes to jpythonc tool. New registry entries + python.jpythonc.compiler, python.jpythonc.classpath, and + python.jpythonc.compileropts. getopt style long/short option + names (old options are deprecated). New -J/--compileropts + option. + - syncing string object methods with experimental CPython 1.6 + string methods. This includes new optional arguments on + startswith() and endswith() and the moving of join() to a method + of the separator string. + - Many other bug fixes and CPython syncs + +04-Jun-1999 JPython 1.1beta1 released + + Highlights of changes since JPython 1.0.3 + + - New and improved jpythonc tool by Jim Hugunin + - New modules contributed by Finn Bock: cStringIO, cPickle, + struct, binascii + - New module synchronize, equivalent to Java's synchronized + keyword + - Operator module now complete + - sys.add_package() no longer necessary, "import java.lang" just works + - Class-based standard exceptions (w/ support for -X option) + - super__ methods are deprecated, use regular Python style + - time.strftime() added + - Java 1.2 style collections support + - Multiple interpreter states + - Most CPython 1.5.2 features have been implemented + - String objects now have methods -- expected CPython 1.6 feature + - Improved performance + - Java inner class support + - keywords are allowed in some locations (e.g. as attribute names) + - New license + - bug fixes + + + + +Local Variables: +mode: indented-text +indent-tabs-mode: nil +End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:17:43
|
Revision: 3423 http://jython.svn.sourceforge.net/jython/?rev=3423&view=rev Author: otmarhumbel Date: 2007-08-19 23:17:39 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/LICENSE.txt Removed Paths: ------------- branches/Release_2_2maint/LICENSE.txt Deleted: branches/Release_2_2maint/LICENSE.txt =================================================================== --- branches/Release_2_2maint/LICENSE.txt 2007-08-20 06:16:55 UTC (rev 3422) +++ branches/Release_2_2maint/LICENSE.txt 2007-08-20 06:17:39 UTC (rev 3423) @@ -1,200 +0,0 @@ - -A. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING JYTHON -======================================================= - -PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 --------------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using this software ("Jython") in source or binary form and -its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Jython alone -or in any derivative version, provided, however, that PSF's License -Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2007 -Python Software Foundation; All Rights Reserved" are retained in -Jython alone or in any derivative version prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Jython or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Jython. - -4. PSF is making Jython available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF JYTHON WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF JYTHON -FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING JYTHON, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Jython, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - -Jython 2.0, 2.1 License -================================ - -Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Jython Developers -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. - - - Neither the name of the Jython Developers nor the names of - its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - -JPython 1.1.x Software License. -========================= - -______________________________________________________________________ - -IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY. - -BY CLICKING ON THE "ACCEPT" BUTTON WHERE INDICATED, OR BY INSTALLING, -COPYING OR OTHERWISE USING THE SOFTWARE, YOU ARE DEEMED TO HAVE AGREED TO -THE TERMS AND CONDITIONS OF THIS AGREEMENT. - -______________________________________________________________________ - -JPython version 1.1.x - - 1. This LICENSE AGREEMENT is between the Corporation for National Research - Initiatives, having an office at 1895 Preston White Drive, Reston, VA - 20191 ("CNRI"), and the Individual or Organization ("Licensee") - accessing and using JPython version 1.1.x in source or binary form and - its associated documentation as provided herein ("Software"). - - 2. Subject to the terms and conditions of this License Agreement, CNRI - hereby grants Licensee a non-exclusive, non-transferable, royalty-free, - world-wide license to reproduce, analyze, test, perform and/or display - publicly, prepare derivative works, distribute, and otherwise use the - Software alone or in any derivative version, provided, however, that - CNRI's License Agreement and CNRI's notice of copyright, i.e., - "Copyright \xA91996-1999 Corporation for National Research Initiatives; - All Rights Reserved" are both retained in the Software, alone or in any - derivative version prepared by Licensee. - - Alternatively, in lieu of CNRI's License Agreement, Licensee may - substitute the following text (omitting the quotes), provided, however, - that such text is displayed prominently in the Software alone or in any - derivative version prepared by Licensee: "JPython (Version 1.1.x) is - made available subject to the terms and conditions in CNRI's License - Agreement. This Agreement may be located on the Internet using the - following unique, persistent identifier (known as a handle): - 1895.22/1006. The License may also be obtained from a proxy server on - the Web using the following URL: http://hdl.handle.net/1895.22/1006." - - 3. In the event Licensee prepares a derivative work that is based on or - incorporates the Software or any part thereof, and wants to make the - derivative work available to the public as provided herein, then - Licensee hereby agrees to indicate in any such work, in a prominently - visible way, the nature of the modifications made to CNRI's Software. - - 4. Licensee may not use CNRI trademarks or trade name, including JPython - or CNRI, in a trademark sense to endorse or promote products or - services of Licensee, or any third party. Licensee may use the mark - JPython in connection with Licensee's derivative versions that are - based on or incorporate the Software, but only in the form - "JPython-based ___________________," or equivalent. - - 5. CNRI is making the Software available to Licensee on an "AS IS" basis. - CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY - OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY - REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY - PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE - ANY THIRD PARTY RIGHTS. - - 6. CNRI SHALL NOT BE LIABLE TO LICENSEE OR OTHER USERS OF THE SOFTWARE FOR - ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF - USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE - THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. SOME STATES DO NOT - ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY SO THE ABOVE DISCLAIMER - MAY NOT APPLY TO LICENSEE. - - 7. This License Agreement may be terminated by CNRI (i) immediately upon - written notice from CNRI of any material breach by the Licensee, if the - nature of the breach is such that it cannot be promptly remedied; or - (ii) sixty (60) days following notice from CNRI to Licensee of a - material remediable breach, if Licensee has not remedied such breach - within that sixty-day period. - - 8. This License Agreement shall be governed by and interpreted in all - respects by the law of the State of Virginia, excluding conflict of law - provisions. Nothing in this Agreement shall be deemed to create any - relationship of agency, partnership, or joint venture between CNRI and - Licensee. - - 9. By clicking on the "ACCEPT" button where indicated, or by installing, - copying or otherwise using the Software, Licensee agrees to be bound by - the terms and conditions of this License Agreement. - - [ACCEPT BUTTON] - -B. HISTORY OF THE SOFTWARE -======================================================= - -JPython was created in late 1997 by Jim Hugunin. Jim was also the -primary developer while he was at CNRI. In February 1999 Barry Warsaw -took over as primary developer and released JPython version 1.1. - -In October 2000 Barry helped move the software to SourceForge -where it was renamed to Jython. Jython 2.0 and 2.1 were developed -under the Jython specific license below. - -From the 2.2 release on, Jython contributors have signed -Python Software Foundation contributor agreements and releases are -covered under the Python Software Foundation license version 2. - -The standard library is covered by the Python Software Foundation -license as well. See the Lib/LICENSE file for details. - -The zxJDBC package was written by Brian Zimmer and originally licensed -under the GNU Public License. The package is now covered by the Jython -Software License. - -The command line interpreter is covered by the Apache Software -License. See the org/apache/LICENSE file for details. - Copied: branches/Release_2_2maint/jython/LICENSE.txt (from rev 3422, branches/Release_2_2maint/LICENSE.txt) =================================================================== --- branches/Release_2_2maint/jython/LICENSE.txt (rev 0) +++ branches/Release_2_2maint/jython/LICENSE.txt 2007-08-20 06:17:39 UTC (rev 3423) @@ -0,0 +1,200 @@ + +A. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING JYTHON +======================================================= + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Jython") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Jython alone +or in any derivative version, provided, however, that PSF's License +Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2007 +Python Software Foundation; All Rights Reserved" are retained in +Jython alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Jython or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Jython. + +4. PSF is making Jython available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF JYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF JYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING JYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Jython, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + +Jython 2.0, 2.1 License +================================ + +Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Jython Developers +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + - Neither the name of the Jython Developers nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + +JPython 1.1.x Software License. +========================= + +______________________________________________________________________ + +IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY. + +BY CLICKING ON THE "ACCEPT" BUTTON WHERE INDICATED, OR BY INSTALLING, +COPYING OR OTHERWISE USING THE SOFTWARE, YOU ARE DEEMED TO HAVE AGREED TO +THE TERMS AND CONDITIONS OF THIS AGREEMENT. + +______________________________________________________________________ + +JPython version 1.1.x + + 1. This LICENSE AGREEMENT is between the Corporation for National Research + Initiatives, having an office at 1895 Preston White Drive, Reston, VA + 20191 ("CNRI"), and the Individual or Organization ("Licensee") + accessing and using JPython version 1.1.x in source or binary form and + its associated documentation as provided herein ("Software"). + + 2. Subject to the terms and conditions of this License Agreement, CNRI + hereby grants Licensee a non-exclusive, non-transferable, royalty-free, + world-wide license to reproduce, analyze, test, perform and/or display + publicly, prepare derivative works, distribute, and otherwise use the + Software alone or in any derivative version, provided, however, that + CNRI's License Agreement and CNRI's notice of copyright, i.e., + "Copyright \xA91996-1999 Corporation for National Research Initiatives; + All Rights Reserved" are both retained in the Software, alone or in any + derivative version prepared by Licensee. + + Alternatively, in lieu of CNRI's License Agreement, Licensee may + substitute the following text (omitting the quotes), provided, however, + that such text is displayed prominently in the Software alone or in any + derivative version prepared by Licensee: "JPython (Version 1.1.x) is + made available subject to the terms and conditions in CNRI's License + Agreement. This Agreement may be located on the Internet using the + following unique, persistent identifier (known as a handle): + 1895.22/1006. The License may also be obtained from a proxy server on + the Web using the following URL: http://hdl.handle.net/1895.22/1006." + + 3. In the event Licensee prepares a derivative work that is based on or + incorporates the Software or any part thereof, and wants to make the + derivative work available to the public as provided herein, then + Licensee hereby agrees to indicate in any such work, in a prominently + visible way, the nature of the modifications made to CNRI's Software. + + 4. Licensee may not use CNRI trademarks or trade name, including JPython + or CNRI, in a trademark sense to endorse or promote products or + services of Licensee, or any third party. Licensee may use the mark + JPython in connection with Licensee's derivative versions that are + based on or incorporate the Software, but only in the form + "JPython-based ___________________," or equivalent. + + 5. CNRI is making the Software available to Licensee on an "AS IS" basis. + CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY + OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY + REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY + PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE + ANY THIRD PARTY RIGHTS. + + 6. CNRI SHALL NOT BE LIABLE TO LICENSEE OR OTHER USERS OF THE SOFTWARE FOR + ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE + THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. SOME STATES DO NOT + ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY SO THE ABOVE DISCLAIMER + MAY NOT APPLY TO LICENSEE. + + 7. This License Agreement may be terminated by CNRI (i) immediately upon + written notice from CNRI of any material breach by the Licensee, if the + nature of the breach is such that it cannot be promptly remedied; or + (ii) sixty (60) days following notice from CNRI to Licensee of a + material remediable breach, if Licensee has not remedied such breach + within that sixty-day period. + + 8. This License Agreement shall be governed by and interpreted in all + respects by the law of the State of Virginia, excluding conflict of law + provisions. Nothing in this Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between CNRI and + Licensee. + + 9. By clicking on the "ACCEPT" button where indicated, or by installing, + copying or otherwise using the Software, Licensee agrees to be bound by + the terms and conditions of this License Agreement. + + [ACCEPT BUTTON] + +B. HISTORY OF THE SOFTWARE +======================================================= + +JPython was created in late 1997 by Jim Hugunin. Jim was also the +primary developer while he was at CNRI. In February 1999 Barry Warsaw +took over as primary developer and released JPython version 1.1. + +In October 2000 Barry helped move the software to SourceForge +where it was renamed to Jython. Jython 2.0 and 2.1 were developed +under the Jython specific license below. + +From the 2.2 release on, Jython contributors have signed +Python Software Foundation contributor agreements and releases are +covered under the Python Software Foundation license version 2. + +The standard library is covered by the Python Software Foundation +license as well. See the Lib/LICENSE file for details. + +The zxJDBC package was written by Brian Zimmer and originally licensed +under the GNU Public License. The package is now covered by the Jython +Software License. + +The command line interpreter is covered by the Apache Software +License. See the org/apache/LICENSE file for details. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:18:08
|
Revision: 3424 http://jython.svn.sourceforge.net/jython/?rev=3424&view=rev Author: otmarhumbel Date: 2007-08-19 23:18:07 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/build.xml Removed Paths: ------------- branches/Release_2_2maint/build.xml Deleted: branches/Release_2_2maint/build.xml =================================================================== --- branches/Release_2_2maint/build.xml 2007-08-20 06:17:39 UTC (rev 3423) +++ branches/Release_2_2maint/build.xml 2007-08-20 06:18:07 UTC (rev 3424) @@ -1,773 +0,0 @@ -<!-- Copyright 2000 Dj Walker-Morgan --> - - -<project name="jython" default="developer-build" basedir="."> - - - <!-- print out some usage hints --> - <target name="usage" description="prints a short usage"> - <echo> -Use case 1: developer build (in your local jython copy) -------------------------------------------------------- - - call target 'developer-build' (which is the default for this build.xml) -This build will create directories /build and /dist below basedir. - - -Use case 2: full build for a release (using svn checkout) ---------------------------------------------------------- - - make sure you have access to the jython subversion repository (https://jython.svn.sourceforge.net/svnroot/jython/trunk) - - override svn.tag in ant.properties (if necessary) - - call target 'full-build' -This build will create a working directory named full_build_${svn.tag} at the same -level as your local directories jython, sandbox and installer. -It will contain a big jython_installer-${jython.version}.jar file suitable for installation. - -Please be aware: -To build older releases, it may be necessary to use an older build.xml, too (with the corresponding tag). -For example it is not possible to build Release_2_2alpha1 with this version of build.xml. - - -Use case 3: build only the parser (grammar) -------------------------------------------- - - override javaccHome in ant.properties (if necessary) - - call target 'parser' -or: - - set javaccHome, either on the command line, or inside parser/build.xml - - call parser/build.xml (default target) -This build will only create files inside org/python/parser. - - -Note on targets ---------------- -The following targets are designed for direct invocation: - - usage - - developer-build - - full-build - - clean (uses developer-build settings if called directly) - - parser (uses developer-build settings if called directly) -Following an ant convention, the callable targets have a description attribute. -All other targets may give unpredicted results if called directly. - - -Where ant.properties are searched ---------------------------------- - 1. in user.home - 2. in the same directory as this build.xml file -The first setting of a property wins, further settings are ignored. - - -Actions for a release ---------------------- - 1. determine the new svn tag to be applied to jython - 2. check the svn:externals property of project jython for an appropriate cpython maintenance branch - 3. change the following properties in this build.xml, if necessary: - - svn.tag (target: full-init) - - jdk.target.version (target: pre-init) - 4. if new CPython .py files should be distributed, add them to build.Lib.include.properties - 5. adjust the public static String version in PySystemState.java - 6. adjust the version strings in target 'version' of this build.xml - (this is for upcoming snapshot builds only) - 7. adjust the url for the cpython maintenance branch in target 'checkout' of this build.xml - 8. check in all the changes - 9. apply the new tag to the jython svn (all projects) - 10. call target 'full-build' - - - -An example ant.properties file: -------------------------------- - -# - define the home for javacc (only used for parser grammar) -javaccHome=${basedir}/../externals/javacc-3.2 - -# - ht2html tool for the doc target (only needed for full-build) -ht2html.dir=${basedir}/../externals/ht2html-2.0 - -# - define the home of the corresponding CPython version -python.home=/Users/groves/dev/src/Python-2.2.3 - -# - javax.servlet -servlet.jar=c:/workspace/HEAD/CH.obj.commons.core/make_lib/j2ee.jar - -# - org.gnu.readline -readline.jar=${basedir}/../externals/external-jars/readline.jar -# - jline -jline.jar=${basedir}/../externals/external-jars/jline-0.9.91.jar - - -# - zxJDBC -# (for mysql, see www.mysql.com/downloads/api-jdbc-stable.html) -# (for postgres, see http://jdbc.postgresql.org/) -mysql.jar=${basedir}/../externals/external-jars/mysql-connector-java-3.0.16-ga-bin.jar -postgresql.jar=${basedir}/../externals/external-jars/pg74.215.jdbc2.jar -oracle.jar=C:/workspace/HEAD/for_development/bisdevsrv28/jboss/server/infra/lib/ojdbc14.jar -#informix.jar= - -# - option for javac (build.compiler=modern is a global option to use standard jdk 1.3/1.4/1.5) -#build.compiler=modern -#jdk.target.version=1.4 -#debug=false -#optimize=off -#deprecation=off - -# - the svn tag to build from; only needed for full-build -#svn.tag=Release_2_2beta2 -#svn.tag=HEAD - -# - the revision; defaults to svn.tag; only needed for full-build -# (uncomment and indicate the correct revision to do a snapshot build) -#svn.revision=3245 - -# - the directory containing libsvnjavahl-1.dll (on windows) and svnjavahl.jar; only needed for full-build -# how to get these: -# - download http://subversion.tigris.org/files/documents/15/31073/svn-win32-1.3.1_javahl.zip (or newer) -# - unzip the .dll and .jar into javahl.dir -javahl.dir=C:/Programme/Subversion/javahl - -# - the directory containing the svnant related .jar files; only needed for full-build -# the following .jar files (probably) are needed: -# - commons-lang-2.0.jar -# - jakarta-regexp-1.3.jar -# - svnant.jar -# - svnClientAdapter.jar -# - svnjavahl.jar -# how to get these: -# - download http://subclipse.tigris.org/files/documents/906/23927/svnant-1.0.0-rc1.zip (or newer) -# - unzip the jar files from /lib folder to svnant.jar.dir -svnant.jar.dir=${basedir}/../externals/svnant-jars - </echo> - </target> - - - <!-- developer build --> - <target name="developer-build" - depends="developer-build-called, developer-init, post-init, template, copy-dist" - description="a local build for developers" - /> - - - <!-- full build --> - <target name="full-build" depends="full-init, post-init, install" description="a full build from svn" /> - - - <!-- set a property to indicate that target 'developer-build' was really called --> - <target name="developer-build-called"> - <property name="developer-build-called" value="true" /> - </target> - - - <!-- initialize properties common to both developer build and full build --> - <target name="pre-init"> - <!-- load from .properties file --> - <echo>loading properties from ${user.home}/ant.properties</echo> - <property file="${user.home}/ant.properties" /> - <echo>loading properties from ${basedir}/ant.properties</echo> - <property file="${basedir}/ant.properties" /> - - <property name="build.compiler" value="modern" /> - <property name="jdk.target.version" value="1.4" /> - <property name="jdk.source.version" value="1.4" /> - <property name="deprecation" value="off" /> - <property name="debug" value="off" /> - <property name="optimize" value="on" /> - <property name="nowarn" value="false" /> - - <!-- classpaths --> - <path id="main.classpath"> - <pathelement path="${readline.jar}" /> - <pathelement path="${jline.jar}" /> - <pathelement path="${servlet.jar}" /> - <pathelement path="${informix.jar}" /> - <pathelement path="${oracle.jar}" /> - <pathelement path="${mysql.jar}" /> - <pathelement path="${postgresql.jar}" /> - <pathelement path="${jndi.jar}" /> - <pathelement path="${jdbc.jar}" /> - <pathelement path="${java.class.path}" /> - </path> - - <available property="threadlocal.present" classname="java.lang.ThreadLocal" /> - <available property="secureclassloader.present" classname="java.security.SecureClassLoader" /> - <available property="servlet.present" classname="javax.servlet.Servlet" classpath="${servlet.jar}" /> - <available property="readline.present" classname="org.gnu.readline.Readline" classpath="${readline.jar}" /> - <available property="jline.present" classname="jline.Terminal" classpath="${jline.jar}" /> - <available property="informix.present" classname="com.informix.jdbc.IfxDriver" classpath="${informix.jar}" /> - <available property="mysql.present" classname="org.gjt.mm.mysql.Driver" classpath="${mysql.jar}" /> - <available property="postgresql.present" classname="org.postgresql.Driver" classpath="${postgresql.jar}" /> - <available property="oracle.present" classname="oracle.jdbc.driver.OracleDriver" classpath="${oracle.jar}" /> - <available property="jndi.present" classname="javax.naming.Context" classpath="${jndi.jar}" /> - <available property="javax.sql.present" classname="javax.sql.DataSource" /> - <available property="jdbc30.present" classname="java.sql.ParameterMetaData" /> - </target> - - - <!-- init properties for the developer build --> - <target name="developer-init" depends="pre-init"> - <property name="work.dir" value="${basedir}" /> - <property name="jython.base.dir" value="${basedir}" /> - <property name="source.dir" value="${basedir}/src" /> - <property name="templates.dir" value="${basedir}/src/templates" /> - <property name="python.lib" value="${basedir}/CPythonLib" /> - <property name="bugtests.dir" value="${basedir}/bugtests" /> - <property name="templates.lazy" value="true" /> - </target> - - - <!-- init properties for the full build --> - <target name="full-init" depends="pre-init"> - <!-- use this property to distinguish a full-build from a developer-build --> - <property name="full-build" value="true" /> - <property name="do.templates" value="true" /> - - <!-- predefined tags for jython and cpython --> - <property name="svn.tag" value="Release_2_2rc3" /> - - <property name="work.dir" value="${basedir}/../full_build_${svn.tag}" /> - <property name="svn.checkout.dir" value="${work.dir}/checkout" /> - <property name="jython.base.dir" value="${svn.checkout.dir}/jython" /> - <property name="source.dir" value="${jython.base.dir}/src" /> - <property name="has.repositories.connection" value="true" /> - <property name="python.lib" value="${jython.base.dir}/CPythonLib" /> - <property name="python.exe" value="${python.home}/python" /> - <condition property="do.checkout" value="true"> - <istrue value="${has.repositories.connection}" /> - </condition> - <condition property="do.snapshot.build"> - <isset property="svn.revision" /> - </condition> - <condition property="jython.version" value="${svn.revision}"> - <isset property="svn.revision" /> - </condition> - <property name="jython.version" value="2.2rc3" /> - <property name="svn.revision" value="HEAD"/> - - <!-- classpath for svn ant task --> - <path id="svn.classpath"> - <pathelement path="${java.class.path}" /> - <fileset dir="${svnant.jar.dir}"> - <include name="*.jar"/> - </fileset> - </path> - <!-- taskdef for svn ant task --> - <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="svn.classpath" /> - <!-- Require all of the optional jars for a full build --> - <fail unless="readline.present" message="readline jar not present" /> - <fail unless="jline.present" message="jline jar not present" /> - <fail unless="servlet.present" message="servlet jar not present" /> - <fail unless="informix.present" message="informix jar not present" /> - <fail unless="mysql.present" message="mysql jar not present" /> - <fail unless="postgresql.present" message="postgres jar not present" /> - <fail unless="oracle.present" message="oracle jar not present" /> - </target> - - - <target name="post-init"> - <property name="output.dir" value="${work.dir}/build" /> - <property name="dist.dir" value="${work.dir}/dist" /> - <property name="apidoc.dir" value="${dist.dir}/Doc/javadoc" /> - <property name="parser.dir" value="${source.dir}/org/python/parser" /> - <echo>.</echo> - <echo>Build environment for ${ant.project.name}</echo> - <echo>(Note: if ${propertyname} is displayed, then the property is not set)</echo> - <echo>--- optional libraries ---</echo> - <echo>threadlocal = '${threadlocal.present}'</echo> - <echo>secureclassloader = '${secureclassloader.present}'</echo> - <echo>servlet = '${servlet.present}'</echo> - <echo>readline = '${readline.present}'</echo> - <echo>jline = '${jline.present}'</echo> - <echo>oracle = '${oracle.present}'</echo> - <echo>informix = '${informix.present}'</echo> - <echo>mysql = '${mysql.present}'</echo> - <echo>postgresql = '${postgresql.present}'</echo> - <echo>jndi = '${jndi.present}'</echo> - <echo>jdbc = '${javax.sql.present}'</echo> - <echo>jdbc3.0 = '${jdbc30.present}'</echo> - <echo>--- properties ---</echo> - <echo>work.dir = '${work.dir}'</echo> - <echo>jython.base.dir = '${jython.base.dir}'</echo> - <echo>source.dir = '${source.dir}'</echo> - <echo>parser.dir = '${parser.dir}'</echo> - <echo>output.dir = '${output.dir}'</echo> - <echo>dist.dir = '${dist.dir}'</echo> - <echo>apidoc.dir = '${apidoc.dir}'</echo> - <echo>python.lib = '${python.lib}'</echo> - <echo>javaccHome = '${javaccHome}'</echo> - <echo>ht2html.dir = '${ht2html.dir}'</echo> - <echo>build.compiler = '${build.compiler}'</echo> - <echo>jdk.target.version = '${jdk.target.version}'</echo> - <echo>jdk.source.version = '${jdk.source.version}'</echo> - <echo>deprecation = '${deprecation}'</echo> - <echo>debug = '${debug}'</echo> - <echo>optimize = '${optimize}'</echo> - <echo>nowarn = '${nowarn}'</echo> - <echo>--- properties (used for full-build only ) ---</echo> - <echo>python.exe = '${python.exe}'</echo> - <echo>svn.tag = '${svn.tag}'</echo> - <echo>svn.checkout.dir = '${svn.checkout.dir}'</echo> - <echo>javahl.dir = '${javahl.dir}'</echo> - <echo>svnant.jar.dir = '${svnant.jar.dir}'</echo> - <echo>svn.revision = '${svn.revision}'</echo> - <echo>do.snapshot.build = '${do.snapshot.build}'</echo> - <echo>do.checkout = '${do.checkout}'</echo> - <echo>do.templates = '${do.templates}'</echo> - </target> - - - <!-- delete what's necessary. should correspond to the directories created in prepare --> - <!-- if called directly, we use settings as in developer-build --> - <!-- (at the moment all properties will already be set if we do a full build) --> - <target name="clean" - depends="developer-init, post-init, clean-checkout-dir" - unless="developer-build-called" - description="clean up build working directories" - > - <!-- do not hard delete ${work.dir}, since it could be ${basedir} --> - <!-- deletes all files and subdirectories of ${output.dir}, without ${output.dir} itself. --> - <delete includeemptydirs="true" failonerror="false"> - <fileset dir="${output.dir}" includes="**/*" /> - </delete> - <!-- deletes all files and subdirectories of ${dist.dir}, without ${dist.dir} itself. --> - <delete includeemptydirs="true" failonerror="false"> - <fileset dir="${dist.dir}" includes="**/*" /> - </delete> - <!-- delete the installation .jar file from ${work.dir}, but no other files --> - <delete failonerror="false"> - <fileset dir="${work.dir}" includes="jython*.jar" /> - </delete> - </target> - - - <!-- clean svn.checkout.dir if we really checkout --> - <target name="clean-checkout-dir" if="do.checkout"> - <delete includeemptydirs="true" failonerror="false"> - <fileset dir="${svn.checkout.dir}" includes="**/*" defaultexcludes="no" /> - </delete> - </target> - - - <!-- create necessary directories --> - <target name="prepare" depends="prepare-full, prepare-checkout"> - <mkdir dir="${output.dir}" /> - <mkdir dir="${dist.dir}" /> - </target> - - - <!-- create directories needed only in full-build --> - <target name="prepare-full" depends="clean" if="full-build"> - <mkdir dir="${work.dir}" /> - <mkdir dir="${dist.dir}/Doc" /> - <mkdir dir="${apidoc.dir}" /> - </target> - - - <!-- create checkout directory if necessary --> - <target name="prepare-checkout" if="do.checkout"> - <mkdir dir="${svn.checkout.dir}" /> - </target> - - - <!-- checkout if so defined --> - <target name="checkout" depends="prepare" if="do.checkout"> - <!-- determine if to checkout from /tags/${svn.tag} (any tag), or /trunk (HEAD) --> - <condition property="svn.main.dir" value="trunk"> - <equals arg1="${svn.tag}" arg2="HEAD" /> - </condition> - <property name="svn.main.dir" value="tags/${svn.tag}" /> - <svn javahl="${javahl.dir}" > - <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" /> - <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" /> - </svn> - - <!-- checkout cpython license from the correct python maintenance branch --> - <svn javahl="${javahl.dir}" > - <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" /> - </svn> - </target> - - - <!-- change the version string, if so defined: used for snapshot builds --> - <!-- the following replacements have to be updated if the version strings - in PySystemState.java and README.txt change --> - <target name="version" depends="checkout" if="do.snapshot.build" > - <property name="replace.value.version" value='version = "2.2rc${svn.revision}"' /> - <replace file="${source.dir}/org/python/core/PySystemState.java" token='version = "2.2rc3"' value="${replace.value.version}" /> - <replace file="${source.dir}/org/python/core/PySystemState.java" token="PY_RELEASE_LEVEL = 0x0C" value="PY_RELEASE_LEVEL = 0xAA" /> - <property name="replace.value.serial" value="PY_RELEASE_SERIAL = ${svn.revision}" /> - <replace file="${source.dir}/org/python/core/PySystemState.java" token="PY_RELEASE_SERIAL = 3" value="${replace.value.serial}" /> - - <!-- change README.txt --> - <replace file="${jython.base.dir}/README.txt" token='2.2rc3' value='2.2rc${svn.revision}' /> - <replace file="${jython.base.dir}/README.txt"> - <replacetoken>=======================</replacetoken> - <replacevalue>-------------------------- - -This is a snapshot build. -It reflects the current development status. - -The readme text for the next release will be like: - - </replacevalue> - </replace> - </target> - - <!-- separate build.xml for parser grammar --> - <!-- we use settings as in developer-build - at the moment all properties will already be set if we do a full build --> - <target name="parser" depends="developer-init, post-init, prepare" if="javaccHome" description="the grammar build"> - <echo>processing ${parser.dir}/build.xml</echo> - <ant dir="${parser.dir}" /> - </target> - - - <!-- prepare template ant task --> - <target name="template-init" depends="prepare" if="do.templates"> - - <javac srcdir="${source.dir}/" - destdir="${output.dir}/" - target="${jdk.target.version}" - source="${jdk.source.version}" - debug="${debug}" - optimize="${optimize}" - deprecation="${deprecation}" - nowarn="${nowarn}" - > - <include name="org/python/util/TemplateAntTask.java" /> - </javac> - </target> - - - <!-- run templates --> - <target name="template" depends="checkout, template-init" if="do.templates"> - <taskdef name="gentempl" classname="org.python.util.TemplateAntTask" - classpath="${output.dir}" /> - <gentempl srcdir="${templates.dir}" verbose="true" - lazy="${templates.lazy}"/> - </target> - - - <!-- compile java sources --> - <target name="compile" depends="version, parser"> - <javac srcdir="${source.dir}/" - destdir="${output.dir}/" - target="${jdk.target.version}" - source="${jdk.source.version}" - debug="${debug}" - optimize="${optimize}" - deprecation="${deprecation}" - nowarn="${nowarn}" - > - <exclude name="org/python/parser/python.java" /> - <exclude name="**/PyServlet.java" unless="servlet.present" /> - <exclude name="**/ReadlineConsole.java" unless="readline.present" /> - <exclude name="**/JLineConsole.java" unless="jline.present" /> - <exclude name="**/handler/InformixDataHandler.java" unless="informix.present" /> - <exclude name="**/handler/MySQLDataHandler.java" unless="mysql.present" /> - <exclude name="**/handler/OracleDataHandler.java" unless="oracle.present" /> - <exclude name="**/handler/PostgresqlDataHandler.java" unless="postgresql.present" /> - <exclude name="**/connect/Lookup.java" unless="jndi.present" /> - <exclude name="**/connect/Lookup.java" unless="javax.sql.present" /> - <exclude name="**/connect/Connectx.java" unless="javax.sql.present" /> - <exclude name="**/JDBC30DataHandler.java" unless="jdbc30.present" /> - <classpath refid="main.classpath" /> - </javac> - - <javac srcdir="${jython.base.dir}/Lib" - includes="jxxload_help/**" - destdir="${output.dir}/" - target="${jdk.target.version}" - source="${jdk.source.version}" - debug="${debug}" - optimize="${optimize}" - deprecation="${deprecation}" - nowarn="${nowarn}" - /> - - <!-- java files used by tests --> - <javac srcdir="${jython.base.dir}/Lib/test/" - includes="javatests/**" - destdir="${output.dir}/" - target="${jdk.target.version}" - source="${jdk.source.version}" - debug="${debug}" - optimize="${optimize}" - deprecation="${deprecation}" - nowarn="${nowarn}" - /> - - <copy file="${source.dir}/org/python/modules/ucnhash.dat" - todir="${output.dir}/org/python/modules" - preservelastmodified="true" - /> - - <copy todir="${output.dir}/com" preservelastmodified="true"> - <fileset dir="${source.dir}/com"> - <include name="**/*.properties" /> - </fileset> - </copy> - </target> - - - <!-- build jython.jar --> - <target name="jar" depends="compile"> - <jar destfile="${dist.dir}/jython.jar" - basedir="${output.dir}" - update="true"> - <include name="com/**/*" /> - <include name="org/**/*" /> - <include name="jxxload_help/*" /> - <include name="javatests/*" /> - <manifest> - <attribute name="Main-Class" value="org.python.util.jython" /> - <attribute name="Built-By" value="${user.name}" /> - <!-- info section. ATTN: no blanks, no '.' in the names --> - <section name="Build-Info"> - <attribute name="version" value="${jython.version}" /> - <attribute name="svn-build" value="${do.checkout}" /> - <attribute name="threadlocal" value="${threadlocal.present}" /> - <attribute name="secureclassloader" value="${secureclassloader.present}" /> - <attribute name="servlet" value="${servlet.present}" /> - <attribute name="readline" value="${readline.present}" /> - <attribute name="jline" value="${jline.present}" /> - <attribute name="oracle" value="${oracle.present}" /> - <attribute name="informix" value="${informix.present}" /> - <attribute name="mysql" value="${mysql.present}" /> - <attribute name="postgresql" value="${postgresql.present}" /> - <attribute name="jndi" value="${jndi.present}" /> - <attribute name="jdbc" value="${javax.sql.present}" /> - <attribute name="jdbc3_0" value="${jdbc30.present}" /> - <attribute name="build-compiler" value="${build.compiler}" /> - <attribute name="jdk-target-version" value="${jdk.target.version}" /> - <attribute name="debug" value="${debug}" /> - <attribute name="optimize" value="${optimize}" /> - </section> - </manifest> - </jar> - </target> - - - <!-- build the .html files using the ht2html tool --> - <target name="doc" depends="compile" if="full-build"> - <fail unless="ht2html.dir" message="ht2html.dir is not set" /> - <copy todir="${dist.dir}/Doc" preservelastmodified="true"> - <fileset dir="Doc" includes="*.ht, **/*.gif" /> - </copy> - <!-- Create .html files in Doc --> - <apply executable="${python.exe}" dir="Doc"> - <env key="PYTHONPATH" path="${jython.base.dir}/Misc/htgen" /> - <arg line="${ht2html.dir}/ht2html.py" /> - <arg line="-s JyLocalGenerator" /> - <fileset dir="${dist.dir}/Doc"> - <include name="*.ht" /> - </fileset> - </apply> - <delete> - <fileset dir="${dist.dir}/Doc" includes="*.ht" /> - </delete> - </target> - - - <!-- javadoc --> - <target name="javadoc" depends="compile" if="full-build"> - <javadoc sourcepath="${source.dir}" - destdir="${apidoc.dir}" - source="${jdk.source.version}" - public="true" - breakiterator="yes" - packagenames="org.python.core, org.python.util, com.ziclix.python.sql" - windowtitle="Jython API documentation" - bottom="<a href='http://www.jython.org' target='_top'>Jython homepage</a>" - > - <classpath refid="main.classpath" /> - </javadoc> - </target> - - - <!-- copy for full distribution --> - <target name="copy-full" if="full-build"> - <!-- Misc files --> - <echo>copy misc files from ${jython.base.dir}</echo> - <copy todir="${dist.dir}" preservelastmodified="true"> - <fileset dir="${jython.base.dir}" - includes="ACKNOWLEDGMENTS, build.xml, build.Lib.include.properties, NEWS, LICENSE.txt, README.txt, registry" - /> - </copy> - - <!-- copy the CPython license --> - <echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo> - <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" /> - - <!-- sources: todir has to correspond with installer/**/JarInstaller.java --> - <echo>copy sources from ${jython.base.dir}</echo> - <copy todir="${dist.dir}/src/java" preservelastmodified="true"> - <fileset dir="${jython.base.dir}"> - <include name="src/**/*.java" /> - <include name="src/com/**/*.properties" /> - <include name="Lib/jxxload_help/*.java" /> - <include name="Lib/test/javatests/*.java" /> - <include name="src/org/**/ucnhash.dat" /> - <include name="src/org/python/parser/build.xml" /> - <exclude name="src/org/python/parser/python.java" /> - </fileset> - </copy> - - <!-- The demo files --> - <echo>copy the demo files from ${jython.base.dir}/Demo</echo> - <copy todir="${dist.dir}/Demo" preservelastmodified="true"> - <fileset dir="${jython.base.dir}/Demo"> - <include name="**/*.java" /> - <include name="**/*.html" /> - <include name="**/*.py" /> - <include name="**/*.txt" /> - <include name="**/*.xml**" /> - <include name="**/jreload/example.jar" /> - <include name="**/jreload/_xample/Version.class" /> - <exclude name="**/jpywork/**" /> - </fileset> - </copy> - </target> - - - <!-- copy for distribution --> - <target name="copy-dist" depends="jar, doc, javadoc, copy-full"> - <!-- Tools: jythonc and freeze --> - <echo>copy Tools from ${jython.base.dir}/Tools</echo> - <copy todir="${dist.dir}" preservelastmodified="true"> - <fileset dir="${jython.base.dir}" includes="Tools/**/*.py" /> - </copy> - - <!-- Copy the CPython standard library files --> - <echo>copy CPython/Lib *.py files from ${python.lib}</echo> - <copy todir="${dist.dir}/Lib" preservelastmodified="true"> - <fileset dir="${python.lib}" excludes="**/*.pyc, **/*.pyo"> - <patternset> - <includesfile name="${jython.base.dir}/build.Lib.include.properties" /> - <exclude name="test/output/test_sax"/> - <exclude name="test/output/test_socket"/> - <exclude name="test/output/test_zlib"/> - </patternset> - </fileset> - </copy> - - <!-- The jython .py modules: important to overwrite the above CPython .py files --> - <echo>copy the jython *.py modules from ${jython.base.dir}/Lib</echo> - <copy todir="${dist.dir}/Lib" preservelastmodified="true" overwrite="true"> - <fileset dir="${jython.base.dir}/Lib" excludes="**/*.class"/> - </copy> - </target> - - - <!-- wrap the build into the installer --> - <target name="install" depends="copy-dist"> - <fail unless="svn.tag" message="no svn.tag specified" /> - <property name="install.src.dir" value="${jython.base.dir}/../installer/src/java" /> - <echo>compiling installer from ${install.src.dir}</echo> - <javac srcdir="${install.src.dir}" - includes="org/**" - destdir="${output.dir}/" - target="${jdk.target.version}" - source="${jdk.source.version}" - debug="${debug}" - optimize="${optimize}" - deprecation="${deprecation}" - nowarn="${nowarn}" - /> - <echo>copy installer classes to ${dist.dir}</echo> - <copy todir="${dist.dir}" preservelastmodified="true"> - <fileset dir="${output.dir}"> - <include name="org/python/util/install/**/*.class" /> - <include name="org/apache/commons/cli/*.class" /> - </fileset> - </copy> - <copy file="${install.src.dir}/org/apache/LICENSE.txt" tofile="${dist.dir}/LICENSE_Apache.txt" preservelastmodified="true" /> - <echo>copy installer icon to ${dist.dir}</echo> - <copy todir="${dist.dir}" preservelastmodified="true"> - <!-- check no /bin directory --> - <fileset dir="${install.src.dir}" includes="**/*.png" excludes="bin/**" /> - </copy> - <echo>building installer .jar file</echo> - <jar destfile="${work.dir}/jython_installer-${jython.version}.jar" basedir="${dist.dir}" update="true"> - <manifest> - <attribute name="Main-Class" value="org.python.util.install.Installation" /> - <attribute name="Built-By" value="${user.name}" /> - <!-- section for the install program --> - <section name="Jython"> - <attribute name="version" value="${jython.version}" /> - <attribute name="exclude-dirs" value="org;META-INF" /> - </section> - <!-- info section. ATTN: no blanks, no '.' in the names --> - <section name="Build-Info"> - <attribute name="svn-build" value="${do.checkout}" /> - <attribute name="threadlocal" value="${threadlocal.present}" /> - <attribute name="secureclassloader" value="${secureclassloader.present}" /> - <attribute name="servlet" value="${servlet.present}" /> - <attribute name="readline" value="${readline.present}" /> - <attribute name="jline" value="${jline.present}" /> - <attribute name="oracle" value="${oracle.present}" /> - <attribute name="informix" value="${informix.present}" /> - <attribute name="mysql" value="${mysql.present}" /> - <attribute name="postgresql" value="${postgresql.present}" /> - <attribute name="jndi" value="${jndi.present}" /> - <attribute name="jdbc" value="${javax.sql.present}" /> - <attribute name="jdbc3_0" value="${jdbc30.present}" /> - <attribute name="build-compiler" value="${build.compiler}" /> - <attribute name="jdk-target-version" value="${jdk.target.version}" /> - <attribute name="debug" value="${debug}" /> - <attribute name="optimize" value="${optimize}" /> - </section> - </manifest> - </jar> - </target> - - <!-- run regression test suite --> - <target name="regrtest" depends="developer-init, post-init"> - <java classname="org.python.util.jython" fork="true"> - <jvmarg value="-Dpython.home=${dist.dir}"/> - <arg value="${dist.dir}/Lib/test/regrtest.py"/> - <classpath> - <pathelement location="${dist.dir}/jython.jar"/> - </classpath> - </java> - </target> - - <!-- run bugtests, create a config if necessary --> - <target name="bugtest" depends="developer-init, post-init, create-bugtest-config"> - <java classname="org.python.util.jython" fork="true" dir="${bugtests.dir}"> - <classpath> - <pathelement location="${dist.dir}/jython.jar"/> - </classpath> - <jvmarg value="-Dpython.home=${dist.dir}"/> - <arg value="driver.py"/> - <!-- uncomment if you want to run only one test: --> - <!-- - <arg value="386"/> - --> - </java> - </target> - - <!-- create support_config.py in the bugtset directory only if it doesn't already exist --> - <target name="create-bugtest-config" depends="developer-init, post-init, check-bugtest-config" unless="have_bugtest_config"> - <!-- doesn't seem to be a direct way to get at the path to javac, - java.home points to the jre folder. The following assumes a standard - jdk layout. Alternative is to try something like: - - <property environment="env"/> - <property name="jdk.home" value="${env.JAVA_HOME}" /> - - or set jdk.home explicitly - --> - <echo>creating ${bugtests.dir}/support_config.py</echo> - <property name="jdk.home" value="${java.home}/.." /> - <echo file="${bugtests.dir}/support_config.py"> -# this configuration was auto-generated by ant build script, -# safe to edit by hand (won't be overwritten) -java_home="${jdk.home}" -jython_home="${dist.dir}" -classpath="${dist.dir}/jython.jar${path.separator}classes" - </echo> - </target> - - <!-- set property have_bugtest_config if support_config.py already exists in the bugtest directory --> - <target name="check-bugtest-config"> - <available property="have_bugtest_config" file="${bugtests.dir}/support_config.py"/> - </target> - -</project> Copied: branches/Release_2_2maint/jython/build.xml (from rev 3423, branches/Release_2_2maint/build.xml) =================================================================== --- branches/Release_2_2maint/jython/build.xml (rev 0) +++ branches/Release_2_2maint/jython/build.xml 2007-08-20 06:18:07 UTC (rev 3424) @@ -0,0 +1,773 @@ +<!-- Copyright 2000 Dj Walker-Morgan --> + + +<project name="jython" default="developer-build" basedir="."> + + + <!-- print out some usage hints --> + <target name="usage" description="prints a short usage"> + <echo> +Use case 1: developer build (in your local jython copy) +------------------------------------------------------- + - call target 'developer-build' (which is the default for this build.xml) +This build will create directories /build and /dist below basedir. + + +Use case 2: full build for a release (using svn checkout) +--------------------------------------------------------- + - make sure you have access to the jython subversion repository (https://jython.svn.sourceforge.net/svnroot/jython/trunk) + - override svn.tag in ant.properties (if necessary) + - call target 'full-build' +This build will create a working directory named full_build_${svn.tag} at the same +level as your local directories jython, sandbox and installer. +It will contain a big jython_installer-${jython.version}.jar file suitable for installation. + +Please be aware: +To build older releases, it may be necessary to use an older build.xml, too (with the corresponding tag). +For example it is not possible to build Release_2_2alpha1 with this version of build.xml. + + +Use case 3: build only the parser (grammar) +------------------------------------------- + - override javaccHome in ant.properties (if necessary) + - call target 'parser' +or: + - set javaccHome, either on the command line, or inside parser/build.xml + - call parser/build.xml (default target) +This build will only create files inside org/python/parser. + + +Note on targets +--------------- +The following targets are designed for direct invocation: + - usage + - developer-build + - full-build + - clean (uses developer-build settings if called directly) + - parser (uses developer-build settings if called directly) +Following an ant convention, the callable targets have a description attribute. +All other targets may give unpredicted results if called directly. + + +Where ant.properties are searched +--------------------------------- + 1. in user.home + 2. in the same directory as this build.xml file +The first setting of a property wins, further settings are ignored. + + +Actions for a release +--------------------- + 1. determine the new svn tag to be applied to jython + 2. check the svn:externals property of project jython for an appropriate cpython maintenance branch + 3. change the following properties in this build.xml, if necessary: + - svn.tag (target: full-init) + - jdk.target.version (target: pre-init) + 4. if new CPython .py files should be distributed, add them to build.Lib.include.properties + 5. adjust the public static String version in PySystemState.java + 6. adjust the version strings in target 'version' of this build.xml + (this is for upcoming snapshot builds only) + 7. adjust the url for the cpython maintenance branch in target 'checkout' of this build.xml + 8. check in all the changes + 9. apply the new tag to the jython svn (all projects) + 10. call target 'full-build' + + + +An example ant.properties file: +------------------------------- + +# - define the home for javacc (only used for parser grammar) +javaccHome=${basedir}/../externals/javacc-3.2 + +# - ht2html tool for the doc target (only needed for full-build) +ht2html.dir=${basedir}/../externals/ht2html-2.0 + +# - define the home of the corresponding CPython version +python.home=/Users/groves/dev/src/Python-2.2.3 + +# - javax.servlet +servlet.jar=c:/workspace/HEAD/CH.obj.commons.core/make_lib/j2ee.jar + +# - org.gnu.readline +readline.jar=${basedir}/../externals/external-jars/readline.jar +# - jline +jline.jar=${basedir}/../externals/external-jars/jline-0.9.91.jar + + +# - zxJDBC +# (for mysql, see www.mysql.com/downloads/api-jdbc-stable.html) +# (for postgres, see http://jdbc.postgresql.org/) +mysql.jar=${basedir}/../externals/external-jars/mysql-connector-java-3.0.16-ga-bin.jar +postgresql.jar=${basedir}/../externals/external-jars/pg74.215.jdbc2.jar +oracle.jar=C:/workspace/HEAD/for_development/bisdevsrv28/jboss/server/infra/lib/ojdbc14.jar +#informix.jar= + +# - option for javac (build.compiler=modern is a global option to use standard jdk 1.3/1.4/1.5) +#build.compiler=modern +#jdk.target.version=1.4 +#debug=false +#optimize=off +#deprecation=off + +# - the svn tag to build from; only needed for full-build +#svn.tag=Release_2_2beta2 +#svn.tag=HEAD + +# - the revision; defaults to svn.tag; only needed for full-build +# (uncomment and indicate the correct revision to do a snapshot build) +#svn.revision=3245 + +# - the directory containing libsvnjavahl-1.dll (on windows) and svnjavahl.jar; only needed for full-build +# how to get these: +# - download http://subversion.tigris.org/files/documents/15/31073/svn-win32-1.3.1_javahl.zip (or newer) +# - unzip the .dll and .jar into javahl.dir +javahl.dir=C:/Programme/Subversion/javahl + +# - the directory containing the svnant related .jar files; only needed for full-build +# the following .jar files (probably) are needed: +# - commons-lang-2.0.jar +# - jakarta-regexp-1.3.jar +# - svnant.jar +# - svnClientAdapter.jar +# - svnjavahl.jar +# how to get these: +# - download http://subclipse.tigris.org/files/documents/906/23927/svnant-1.0.0-rc1.zip (or newer) +# - unzip the jar files from /lib folder to svnant.jar.dir +svnant.jar.dir=${basedir}/../externals/svnant-jars + </echo> + </target> + + + <!-- developer build --> + <target name="developer-build" + depends="developer-build-called, developer-init, post-init, template, copy-dist" + description="a local build for developers" + /> + + + <!-- full build --> + <target name="full-build" depends="full-init, post-init, install" description="a full build from svn" /> + + + <!-- set a property to indicate that target 'developer-build' was really called --> + <target name="developer-build-called"> + <property name="developer-build-called" value="true" /> + </target> + + + <!-- initialize properties common to both developer build and full build --> + <target name="pre-init"> + <!-- load from .properties file --> + <echo>loading properties from ${user.home}/ant.properties</echo> + <property file="${user.home}/ant.properties" /> + <echo>loading properties from ${basedir}/ant.properties</echo> + <property file="${basedir}/ant.properties" /> + + <property name="build.compiler" value="modern" /> + <property name="jdk.target.version" value="1.4" /> + <property name="jdk.source.version" value="1.4" /> + <property name="deprecation" value="off" /> + <property name="debug" value="off" /> + <property name="optimize" value="on" /> + <property name="nowarn" value="false" /> + + <!-- classpaths --> + <path id="main.classpath"> + <pathelement path="${readline.jar}" /> + <pathelement path="${jline.jar}" /> + <pathelement path="${servlet.jar}" /> + <pathelement path="${informix.jar}" /> + <pathelement path="${oracle.jar}" /> + <pathelement path="${mysql.jar}" /> + <pathelement path="${postgresql.jar}" /> + <pathelement path="${jndi.jar}" /> + <pathelement path="${jdbc.jar}" /> + <pathelement path="${java.class.path}" /> + </path> + + <available property="threadlocal.present" classname="java.lang.ThreadLocal" /> + <available property="secureclassloader.present" classname="java.security.SecureClassLoader" /> + <available property="servlet.present" classname="javax.servlet.Servlet" classpath="${servlet.jar}" /> + <available property="readline.present" classname="org.gnu.readline.Readline" classpath="${readline.jar}" /> + <available property="jline.present" classname="jline.Terminal" classpath="${jline.jar}" /> + <available property="informix.present" classname="com.informix.jdbc.IfxDriver" classpath="${informix.jar}" /> + <available property="mysql.present" classname="org.gjt.mm.mysql.Driver" classpath="${mysql.jar}" /> + <available property="postgresql.present" classname="org.postgresql.Driver" classpath="${postgresql.jar}" /> + <available property="oracle.present" classname="oracle.jdbc.driver.OracleDriver" classpath="${oracle.jar}" /> + <available property="jndi.present" classname="javax.naming.Context" classpath="${jndi.jar}" /> + <available property="javax.sql.present" classname="javax.sql.DataSource" /> + <available property="jdbc30.present" classname="java.sql.ParameterMetaData" /> + </target> + + + <!-- init properties for the developer build --> + <target name="developer-init" depends="pre-init"> + <property name="work.dir" value="${basedir}" /> + <property name="jython.base.dir" value="${basedir}" /> + <property name="source.dir" value="${basedir}/src" /> + <property name="templates.dir" value="${basedir}/src/templates" /> + <property name="python.lib" value="${basedir}/CPythonLib" /> + <property name="bugtests.dir" value="${basedir}/bugtests" /> + <property name="templates.lazy" value="true" /> + </target> + + + <!-- init properties for the full build --> + <target name="full-init" depends="pre-init"> + <!-- use this property to distinguish a full-build from a developer-build --> + <property name="full-build" value="true" /> + <property name="do.templates" value="true" /> + + <!-- predefined tags for jython and cpython --> + <property name="svn.tag" value="Release_2_2rc3" /> + + <property name="work.dir" value="${basedir}/../full_build_${svn.tag}" /> + <property name="svn.checkout.dir" value="${work.dir}/checkout" /> + <property name="jython.base.dir" value="${svn.checkout.dir}/jython" /> + <property name="source.dir" value="${jython.base.dir}/src" /> + <property name="has.repositories.connection" value="true" /> + <property name="python.lib" value="${jython.base.dir}/CPythonLib" /> + <property name="python.exe" value="${python.home}/python" /> + <condition property="do.checkout" value="true"> + <istrue value="${has.repositories.connection}" /> + </condition> + <condition property="do.snapshot.build"> + <isset property="svn.revision" /> + </condition> + <condition property="jython.version" value="${svn.revision}"> + <isset property="svn.revision" /> + </condition> + <property name="jython.version" value="2.2rc3" /> + <property name="svn.revision" value="HEAD"/> + + <!-- classpath for svn ant task --> + <path id="svn.classpath"> + <pathelement path="${java.class.path}" /> + <fileset dir="${svnant.jar.dir}"> + <include name="*.jar"/> + </fileset> + </path> + <!-- taskdef for svn ant task --> + <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="svn.classpath" /> + <!-- Require all of the optional jars for a full build --> + <fail unless="readline.present" message="readline jar not present" /> + <fail unless="jline.present" message="jline jar not present" /> + <fail unless="servlet.present" message="servlet jar not present" /> + <fail unless="informix.present" message="informix jar not present" /> + <fail unless="mysql.present" message="mysql jar not present" /> + <fail unless="postgresql.present" message="postgres jar not present" /> + <fail unless="oracle.present" message="oracle jar not present" /> + </target> + + + <target name="post-init"> + <property name="output.dir" value="${work.dir}/build" /> + <property name="dist.dir" value="${work.dir}/dist" /> + <property name="apidoc.dir" value="${dist.dir}/Doc/javadoc" /> + <property name="parser.dir" value="${source.dir}/org/python/parser" /> + <echo>.</echo> + <echo>Build environment for ${ant.project.name}</echo> + <echo>(Note: if ${propertyname} is displayed, then the property is not set)</echo> + <echo>--- optional libraries ---</echo> + <echo>threadlocal = '${threadlocal.present}'</echo> + <echo>secureclassloader = '${secureclassloader.present}'</echo> + <echo>servlet = '${servlet.present}'</echo> + <echo>readline = '${readline.present}'</echo> + <echo>jline = '${jline.present}'</echo> + <echo>oracle = '${oracle.present}'</echo> + <echo>informix = '${informix.present}'</echo> + <echo>mysql = '${mysql.present}'</echo> + <echo>postgresql = '${postgresql.present}'</echo> + <echo>jndi = '${jndi.present}'</echo> + <echo>jdbc = '${javax.sql.present}'</echo> + <echo>jdbc3.0 = '${jdbc30.present}'</echo> + <echo>--- properties ---</echo> + <echo>work.dir = '${work.dir}'</echo> + <echo>jython.base.dir = '${jython.base.dir}'</echo> + <echo>source.dir = '${source.dir}'</echo> + <echo>parser.dir = '${parser.dir}'</echo> + <echo>output.dir = '${output.dir}'</echo> + <echo>dist.dir = '${dist.dir}'</echo> + <echo>apidoc.dir = '${apidoc.dir}'</echo> + <echo>python.lib = '${python.lib}'</echo> + <echo>javaccHome = '${javaccHome}'</echo> + <echo>ht2html.dir = '${ht2html.dir}'</echo> + <echo>build.compiler = '${build.compiler}'</echo> + <echo>jdk.target.version = '${jdk.target.version}'</echo> + <echo>jdk.source.version = '${jdk.source.version}'</echo> + <echo>deprecation = '${deprecation}'</echo> + <echo>debug = '${debug}'</echo> + <echo>optimize = '${optimize}'</echo> + <echo>nowarn = '${nowarn}'</echo> + <echo>--- properties (used for full-build only ) ---</echo> + <echo>python.exe = '${python.exe}'</echo> + <echo>svn.tag = '${svn.tag}'</echo> + <echo>svn.checkout.dir = '${svn.checkout.dir}'</echo> + <echo>javahl.dir = '${javahl.dir}'</echo> + <echo>svnant.jar.dir = '${svnant.jar.dir}'</echo> + <echo>svn.revision = '${svn.revision}'</echo> + <echo>do.snapshot.build = '${do.snapshot.build}'</echo> + <echo>do.checkout = '${do.checkout}'</echo> + <echo>do.templates = '${do.templates}'</echo> + </target> + + + <!-- delete what's necessary. should correspond to the directories created in prepare --> + <!-- if called directly, we use settings as in developer-build --> + <!-- (at the moment all properties will already be set if we do a full build) --> + <target name="clean" + depends="developer-init, post-init, clean-checkout-dir" + unless="developer-build-called" + description="clean up build working directories" + > + <!-- do not hard delete ${work.dir}, since it could be ${basedir} --> + <!-- deletes all files and subdirectories of ${output.dir}, without ${output.dir} itself. --> + <delete includeemptydirs="true" failonerror="false"> + <fileset dir="${output.dir}" includes="**/*" /> + </delete> + <!-- deletes all files and subdirectories of ${dist.dir}, without ${dist.dir} itself. --> + <delete includeemptydirs="true" failonerror="false"> + <fileset dir="${dist.dir}" includes="**/*" /> + </delete> + <!-- delete the installation .jar file from ${work.dir}, but no other files --> + <delete failonerror="false"> + <fileset dir="${work.dir}" includes="jython*.jar" /> + </delete> + </target> + + + <!-- clean svn.checkout.dir if we really checkout --> + <target name="clean-checkout-dir" if="do.checkout"> + <delete includeemptydirs="true" failonerror="false"> + <fileset dir="${svn.checkout.dir}" includes="**/*" defaultexcludes="no" /> + </delete> + </target> + + + <!-- create necessary directories --> + <target name="prepare" depends="prepare-full, prepare-checkout"> + <mkdir dir="${output.dir}" /> + <mkdir dir="${dist.dir}" /> + </target> + + + <!-- create directories needed only in full-build --> + <target name="prepare-full" depends="clean" if="full-build"> + <mkdir dir="${work.dir}" /> + <mkdir dir="${dist.dir}/Doc" /> + <mkdir dir="${apidoc.dir}" /> + </target> + + + <!-- create checkout directory if necessary --> + <target name="prepare-checkout" if="do.checkout"> + <mkdir dir="${svn.checkout.dir}" /> + </target> + + + <!-- checkout if so defined --> + <target name="checkout" depends="prepare" if="do.checkout"> + <!-- determine if to checkout from /tags/${svn.tag} (any tag), or /trunk (HEAD) --> + <condition property="svn.main.dir" value="trunk"> + <equals arg1="${svn.tag}" arg2="HEAD" /> + </condition> + <property name="svn.main.dir" value="tags/${svn.tag}" /> + <svn javahl="${javahl.dir}" > + <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" /> + <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" /> + </svn> + + <!-- checkout cpython license from the correct python maintenance branch --> + <svn javahl="${javahl.dir}" > + <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" /> + </svn> + </target> + + + <!-- change the version string, if so defined: used for snapshot builds --> + <!-- the following replacements have to be updated if the version strings + in PySystemState.java and README.txt change --> + <target name="version" depends="checkout" if="do.snapshot.build" > + <property name="replace.value.version" value='version = "2.2rc${svn.revision}"' /> + <replace file="${source.dir}/org/python/core/PySystemState.java" token='version = "2.2rc3"' value="${replace.value.version}" /> + <replace file="${source.dir}/org/python/core/PySystemState.java" token="PY_RELEASE_LEVEL = 0x0C" value="PY_RELEASE_LEVEL = 0xAA" /> + <property name="replace.value.serial" value="PY_RELEASE_SERIAL = ${svn.revision}" /> + <replace file="${source.dir}/org/python/core/PySystemState.java" token="PY_RELEASE_SERIAL = 3" value="${replace.value.serial}" /> + + <!-- change README.txt --> + <replace file="${jython.base.dir}/README.txt" token='2.2rc3' value='2.2rc${svn.revision}' /> + <replace file="${jython.base.dir}/README.txt"> + <replacetoken>=======================</replacetoken> + <replacevalue>-------------------------- + +This is a snapshot build. +It reflects the current development status. + +The readme text for the next release will be like: + + </replacevalue> + </replace> + </target> + + <!-- separate build.xml for parser grammar --> + <!-- we use settings as in developer-build - at the moment all properties will already be set if we do a full build --> + <target name="parser" depends="developer-init, post-init, prepare" if="javaccHome" description="the grammar build"> + <echo>processing ${parser.dir}/build.xml</echo> + <ant dir="${parser.dir}" /> + </target> + + + <!-- prepare template ant task --> + <target name="template-init" depends="prepare" if="do.templates"> + + <javac srcdir="${source.dir}/" + destdir="${output.dir}/" + target="${jdk.target.version}" + source="${jdk.source.version}" + debug="${debug}" + optimize="${optimize}" + deprecation="${deprecation}" + nowarn="${nowarn}" + > + <include name="org/python/util/TemplateAntTask.java" /> + </javac> + </target> + + + <!-- run templates --> + <target name="template" depends="checkout, template-init" if="do.templates"> + <taskdef name="gentempl" classname="org.python.util.TemplateAntTask" + classpath="${output.dir}" /> + <gentempl srcdir="${templates.dir}" verbose="true" + lazy="${templates.lazy}"/> + </target> + + + <!-- compile java sources --> + <target name="compile" depends="version, parser"> + <javac srcdir="${source.dir}/" + destdir="${output.dir}/" + target="${jdk.target.version}" + source="${jdk.source.version}" + debug="${debug}" + optimize="${optimize}" + deprecation="${deprecation}" + nowarn="${nowarn}" + > + <exclude name="org/python/parser/python.java" /> + <exclude name="**/PyServlet.java" unless="servlet.present" /> + <exclude name="**/ReadlineConsole.java" unless="readline.present" /> + <exclude name="**/JLineConsole.java" unless="jline.present" /> + <exclude name="**/handler/InformixDataHandler.java" unless="informix.present" /> + <exclude name="**/handler/MySQLDataHandler.java" unless="mysql.present" /> + <exclude name="**/handler/OracleDataHandler.java" unless="oracle.present" /> + <exclude name="**/handler/PostgresqlDataHandler.java" unless="postgresql.present" /> + <exclude name="**/connect/Lookup.java" unless="jndi.present" /> + <exclude name="**/connect/Lookup.java" unless="javax.sql.present" /> + <exclude name="**/connect/Connectx.java" unless="javax.sql.present" /> + <exclude name="**/JDBC30DataHandler.java" unless="jdbc30.present" /> + <classpath refid="main.classpath" /> + </javac> + + <javac srcdir="${jython.base.dir}/Lib" + includes="jxxload_help/**" + destdir="${output.dir}/" + target="${jdk.target.version}" + source="${jdk.source.version}" + debug="${debug}" + optimize="${optimize}" + deprecation="${deprecation}" + nowarn="${nowarn}" + /> + + <!-- java files used by tests --> + <javac srcdir="${jython.base.dir}/Lib/test/" + includes="javatests/**" + destdir="${output.dir}/" + target="${jdk.target.version}" + source="${jdk.source.version}" + debug="${debug}" + optimize="${optimize}" + deprec... [truncated message content] |
From: <otm...@us...> - 2007-08-20 06:18:55
|
Revision: 3425 http://jython.svn.sourceforge.net/jython/?rev=3425&view=rev Author: otmarhumbel Date: 2007-08-19 23:18:40 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/build.Lib.include.properties Removed Paths: ------------- branches/Release_2_2maint/build.Lib.include.properties Deleted: branches/Release_2_2maint/build.Lib.include.properties =================================================================== --- branches/Release_2_2maint/build.Lib.include.properties 2007-08-20 06:18:07 UTC (rev 3424) +++ branches/Release_2_2maint/build.Lib.include.properties 2007-08-20 06:18:40 UTC (rev 3425) @@ -1,132 +0,0 @@ -# files to be copied from the CPython Lib distribution, -# used as fileset in build.xml (target copy-full) - -# Lib directories, in alphabetical order: -email/*.py -email/test/*.py -email/test/data/* -encodings/*.py -test/** - -# Lib files, in alphabetical order: -__future__.py -aifc.py -anydbm.py -atexit.py -BaseHTTPServer.py -base64.py -bdb.py -binhex.py -bisect.py -calendar.py -cgi.py -CGIHTTPServer.py -chunk.py -cmd.py -cmp.py -cmpcache.py -code.py -codecs.py -colorsys.py -commands.py -compileall.py -ConfigParser.py -copy.py -copy_reg.py -Cookie.py -difflib.py -dircache.py -dircmp.py -doctest.py -dospath.py -dumbdbm.py -exceptions.py -fileinput.py -fnmatch.py -formatter.py -fpformat.py -ftplib.py -getopt.py -glob.py -gopherlib.py -gzip.py -hmac.py -htmlentitydefs.py -htmllib.py -HTMLParser.py -httplib.py -imaplib.py -imghdr.py -keyword.py -linecache.py -macpath.py -macurl2path.py -mailbox.py -mailcap.py -markupbase.py -mhlib.py -mimetools.py -mimetypes.py -MimeWriter.py -mimify.py -multifile.py -mutex.py -netrc.py -nntplib.py -ntpath.py -nturl2path.py -pdb.py -pickle.py -pipes.py -poplib.py -posixfile.py -posixpath.py -pprint.py -profile.py -pstats.py -pyclbr.py -Queue.py -quopri.py -random.py -reconvert.py -repr.py -rfc822.py -sched.py -sgmllib.py -shelve.py -shlex.py -shutil.py -SimpleHTTPServer.py -SimpleXMLRPCServer.py -site.py -smtplib.py -sndhdr.py -SocketServer.py -sre*.py -stat.py -StringIO.py -symbol.py -tempfile.py -this.py -threading.py -token.py -tokenize.py -traceback.py -tzparse.py -unittest.py -urllib.py -urllib2.py -urlparse.py -user.py -UserDict.py -UserList.py -UserString.py -uu.py -warnings.py -weakref.py -whichdb.py -whrandom.py -xdrlib.py -xmllib.py -xmlrpclib.py -zipfile.py Copied: branches/Release_2_2maint/jython/build.Lib.include.properties (from rev 3424, branches/Release_2_2maint/build.Lib.include.properties) =================================================================== --- branches/Release_2_2maint/jython/build.Lib.include.properties (rev 0) +++ branches/Release_2_2maint/jython/build.Lib.include.properties 2007-08-20 06:18:40 UTC (rev 3425) @@ -0,0 +1,132 @@ +# files to be copied from the CPython Lib distribution, +# used as fileset in build.xml (target copy-full) + +# Lib directories, in alphabetical order: +email/*.py +email/test/*.py +email/test/data/* +encodings/*.py +test/** + +# Lib files, in alphabetical order: +__future__.py +aifc.py +anydbm.py +atexit.py +BaseHTTPServer.py +base64.py +bdb.py +binhex.py +bisect.py +calendar.py +cgi.py +CGIHTTPServer.py +chunk.py +cmd.py +cmp.py +cmpcache.py +code.py +codecs.py +colorsys.py +commands.py +compileall.py +ConfigParser.py +copy.py +copy_reg.py +Cookie.py +difflib.py +dircache.py +dircmp.py +doctest.py +dospath.py +dumbdbm.py +exceptions.py +fileinput.py +fnmatch.py +formatter.py +fpformat.py +ftplib.py +getopt.py +glob.py +gopherlib.py +gzip.py +hmac.py +htmlentitydefs.py +htmllib.py +HTMLParser.py +httplib.py +imaplib.py +imghdr.py +keyword.py +linecache.py +macpath.py +macurl2path.py +mailbox.py +mailcap.py +markupbase.py +mhlib.py +mimetools.py +mimetypes.py +MimeWriter.py +mimify.py +multifile.py +mutex.py +netrc.py +nntplib.py +ntpath.py +nturl2path.py +pdb.py +pickle.py +pipes.py +poplib.py +posixfile.py +posixpath.py +pprint.py +profile.py +pstats.py +pyclbr.py +Queue.py +quopri.py +random.py +reconvert.py +repr.py +rfc822.py +sched.py +sgmllib.py +shelve.py +shlex.py +shutil.py +SimpleHTTPServer.py +SimpleXMLRPCServer.py +site.py +smtplib.py +sndhdr.py +SocketServer.py +sre*.py +stat.py +StringIO.py +symbol.py +tempfile.py +this.py +threading.py +token.py +tokenize.py +traceback.py +tzparse.py +unittest.py +urllib.py +urllib2.py +urlparse.py +user.py +UserDict.py +UserList.py +UserString.py +uu.py +warnings.py +weakref.py +whichdb.py +whrandom.py +xdrlib.py +xmllib.py +xmlrpclib.py +zipfile.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:19:30
|
Revision: 3426 http://jython.svn.sourceforge.net/jython/?rev=3426&view=rev Author: otmarhumbel Date: 2007-08-19 23:19:10 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/ACKNOWLEDGMENTS Removed Paths: ------------- branches/Release_2_2maint/ACKNOWLEDGMENTS Deleted: branches/Release_2_2maint/ACKNOWLEDGMENTS =================================================================== --- branches/Release_2_2maint/ACKNOWLEDGMENTS 2007-08-20 06:18:40 UTC (rev 3425) +++ branches/Release_2_2maint/ACKNOWLEDGMENTS 2007-08-20 06:19:10 UTC (rev 3426) @@ -1,73 +0,0 @@ -ACKNOWLEDGMENTS -Copyright \xA9 Corporation for National Research Initiatives - - Jim Hugunin invented JPython and was the primary developer while - he was at CNRI. In February 1999, Jim left CNRI for sunny - California and Barry Warsaw became the primary maintainer. - When Barry and the rest of PythonLabs left CNRI, Barry renamed - JPython to Jython, put the sources on SourceForge and made - Finn Bock the primary maintainer. - - Python's inventor Guido van Rossum and the rest of PythonLabs - continues to help and support Jython by their understanding - of how Jython must live with the limits of Java. - - You can contact the Jython maintainers directly via - jyt...@li..., or the Jython community at - jyt...@li.... - - Harry Mantakos contributed the underlying md5 implementation. - - The SHA1 implementation is taken from cryptix. - - Samuele Pedroni has designed and implemented the improved - PackageManagers and java reload support and also fixed a lot - of bugs. - - Kevin Butler has written and contributed the code for os.environ and - os.system(). - - Brian Zimmer contributed zxJDBC which is a Python DB API subsystem. - - Cyrille Morvan has written the code for the Jythonc ant task. - - A huge thanks goes to all the members of the jpython/jython - mailing lists. Other folks who have contributed to JPython and - Jython in ways large and small, in no particular order: - - Greg Ward - Tony Plate - Jim Althoff - Drew Morrissey - John Mudd - Bryn Keller - dsyer - Tim Hochberg - Bernhard Bablok - Dj Walker-Morgan - Ivan Kougaenko - Ype Kingma - Ian Castleden - Kent Johnson - Robert W. Bill - Durant Schoon - Phil Surette - Michael Becke - Randy Jay Yarger - Matt Conway - Noel (Nick) Lockwood - Steffen Ries - Ben Burton - Josselin PUJO - Steve Cohen - Alexey N. Solofnenko - Charles Duffy - Rodrigo B. de Oliveira - Nathan Franzen - Aleks Totic - Randolph Brown - -Local Variables: -mode: indented-text -indent-tabs-mode: nil -End: Copied: branches/Release_2_2maint/jython/ACKNOWLEDGMENTS (from rev 3425, branches/Release_2_2maint/ACKNOWLEDGMENTS) =================================================================== --- branches/Release_2_2maint/jython/ACKNOWLEDGMENTS (rev 0) +++ branches/Release_2_2maint/jython/ACKNOWLEDGMENTS 2007-08-20 06:19:10 UTC (rev 3426) @@ -0,0 +1,73 @@ +ACKNOWLEDGMENTS +Copyright \xA9 Corporation for National Research Initiatives + + Jim Hugunin invented JPython and was the primary developer while + he was at CNRI. In February 1999, Jim left CNRI for sunny + California and Barry Warsaw became the primary maintainer. + When Barry and the rest of PythonLabs left CNRI, Barry renamed + JPython to Jython, put the sources on SourceForge and made + Finn Bock the primary maintainer. + + Python's inventor Guido van Rossum and the rest of PythonLabs + continues to help and support Jython by their understanding + of how Jython must live with the limits of Java. + + You can contact the Jython maintainers directly via + jyt...@li..., or the Jython community at + jyt...@li.... + + Harry Mantakos contributed the underlying md5 implementation. + + The SHA1 implementation is taken from cryptix. + + Samuele Pedroni has designed and implemented the improved + PackageManagers and java reload support and also fixed a lot + of bugs. + + Kevin Butler has written and contributed the code for os.environ and + os.system(). + + Brian Zimmer contributed zxJDBC which is a Python DB API subsystem. + + Cyrille Morvan has written the code for the Jythonc ant task. + + A huge thanks goes to all the members of the jpython/jython + mailing lists. Other folks who have contributed to JPython and + Jython in ways large and small, in no particular order: + + Greg Ward + Tony Plate + Jim Althoff + Drew Morrissey + John Mudd + Bryn Keller + dsyer + Tim Hochberg + Bernhard Bablok + Dj Walker-Morgan + Ivan Kougaenko + Ype Kingma + Ian Castleden + Kent Johnson + Robert W. Bill + Durant Schoon + Phil Surette + Michael Becke + Randy Jay Yarger + Matt Conway + Noel (Nick) Lockwood + Steffen Ries + Ben Burton + Josselin PUJO + Steve Cohen + Alexey N. Solofnenko + Charles Duffy + Rodrigo B. de Oliveira + Nathan Franzen + Aleks Totic + Randolph Brown + +Local Variables: +mode: indented-text +indent-tabs-mode: nil +End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:20:13
|
Revision: 3427 http://jython.svn.sourceforge.net/jython/?rev=3427&view=rev Author: otmarhumbel Date: 2007-08-19 23:19:40 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/.cvsignore Removed Paths: ------------- branches/Release_2_2maint/.cvsignore Deleted: branches/Release_2_2maint/.cvsignore =================================================================== --- branches/Release_2_2maint/.cvsignore 2007-08-20 06:19:10 UTC (rev 3426) +++ branches/Release_2_2maint/.cvsignore 2007-08-20 06:19:40 UTC (rev 3427) @@ -1,10 +0,0 @@ -.classpath -.project -*.ipr -*.iws -*.iml -build -dist -ant.properties -bin -cachedir Copied: branches/Release_2_2maint/jython/.cvsignore (from rev 3426, branches/Release_2_2maint/.cvsignore) =================================================================== --- branches/Release_2_2maint/jython/.cvsignore (rev 0) +++ branches/Release_2_2maint/jython/.cvsignore 2007-08-20 06:19:40 UTC (rev 3427) @@ -0,0 +1,10 @@ +.classpath +.project +*.ipr +*.iws +*.iml +build +dist +ant.properties +bin +cachedir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:20:30
|
Revision: 3428 http://jython.svn.sourceforge.net/jython/?rev=3428&view=rev Author: otmarhumbel Date: 2007-08-19 23:20:15 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/Tools/ Removed Paths: ------------- branches/Release_2_2maint/Tools/ Copied: branches/Release_2_2maint/jython/Tools (from rev 3427, branches/Release_2_2maint/Tools) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:21:28
|
Revision: 3429 http://jython.svn.sourceforge.net/jython/?rev=3429&view=rev Author: otmarhumbel Date: 2007-08-19 23:20:45 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/src/ Removed Paths: ------------- branches/Release_2_2maint/src/ Copied: branches/Release_2_2maint/jython/src (from rev 3428, branches/Release_2_2maint/src) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:22:00
|
Revision: 3430 http://jython.svn.sourceforge.net/jython/?rev=3430&view=rev Author: otmarhumbel Date: 2007-08-19 23:21:45 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/Misc/ Removed Paths: ------------- branches/Release_2_2maint/Misc/ Copied: branches/Release_2_2maint/jython/Misc (from rev 3429, branches/Release_2_2maint/Misc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:22:26
|
Revision: 3431 http://jython.svn.sourceforge.net/jython/?rev=3431&view=rev Author: otmarhumbel Date: 2007-08-19 23:22:12 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/maven/ Removed Paths: ------------- branches/Release_2_2maint/maven/ Copied: branches/Release_2_2maint/jython/maven (from rev 3430, branches/Release_2_2maint/maven) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:23:04
|
Revision: 3432 http://jython.svn.sourceforge.net/jython/?rev=3432&view=rev Author: otmarhumbel Date: 2007-08-19 23:22:57 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/Lib/ Removed Paths: ------------- branches/Release_2_2maint/Lib/ Copied: branches/Release_2_2maint/jython/Lib (from rev 3431, branches/Release_2_2maint/Lib) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:23:36
|
Revision: 3433 http://jython.svn.sourceforge.net/jython/?rev=3433&view=rev Author: otmarhumbel Date: 2007-08-19 23:23:34 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/Doc/ Removed Paths: ------------- branches/Release_2_2maint/Doc/ Copied: branches/Release_2_2maint/jython/Doc (from rev 3432, branches/Release_2_2maint/Doc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:24:17
|
Revision: 3434 http://jython.svn.sourceforge.net/jython/?rev=3434&view=rev Author: otmarhumbel Date: 2007-08-19 23:24:03 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/Demo/ Removed Paths: ------------- branches/Release_2_2maint/Demo/ Copied: branches/Release_2_2maint/jython/Demo (from rev 3433, branches/Release_2_2maint/Demo) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2007-08-20 06:24:54
|
Revision: 3435 http://jython.svn.sourceforge.net/jython/?rev=3435&view=rev Author: otmarhumbel Date: 2007-08-19 23:24:38 -0700 (Sun, 19 Aug 2007) Log Message: ----------- implement a consistent directory structure on Release_2_2maint branch, trunk and release candidates. Added Paths: ----------- branches/Release_2_2maint/jython/bugtests/ Removed Paths: ------------- branches/Release_2_2maint/bugtests/ Copied: branches/Release_2_2maint/jython/bugtests (from rev 3434, branches/Release_2_2maint/bugtests) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2007-09-19 11:09:37
|
Revision: 3484 http://jython.svn.sourceforge.net/jython/?rev=3484&view=rev Author: cgroves Date: 2007-09-19 04:09:34 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Merged revisions 3471-3474,3479-3480 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3471 | pjenvey | 2007-09-12 17:21:35 -0700 (Wed, 12 Sep 2007) | 1 line prefer importing to using fully qualified names ........ r3472 | pjenvey | 2007-09-12 18:11:26 -0700 (Wed, 12 Sep 2007) | 3 lines s/jpython/jython/g in Lib, Tools and src dirs, except in a few places when referring to historical JPython versions ........ r3473 | pjenvey | 2007-09-12 19:24:24 -0700 (Wed, 12 Sep 2007) | 4 lines override PyDictionary __contains__ to use the optimized dict___contains__ patch: #1783803 thanks ayeshaiqbal ........ r3474 | cgroves | 2007-09-15 14:08:30 -0700 (Sat, 15 Sep 2007) | 1 line Pass *args through to UserDict on pop on LazyDict ........ r3480 | cgroves | 2007-09-19 01:59:31 -0700 (Wed, 19 Sep 2007) | 12 lines Replace all String to byte and byte to String operations that use the default charset with PyString.to_bytes and PyString.from_bytes respectively. These methods assume Strings are being used as byte arrays and have nothing in the high-order half of their chars. They should be used be your one stop shop for byte to String and vice-versa manipulations in Jython. Also make PyUnicode.__str__ encode its string before stuffing it in a PyString. Hopefully this fixes our stomp-indiscriminately-on-your-bytes features that come up if your JVM has a flavorful default charset. ........ Modified Paths: -------------- branches/Release_2_2maint/jython/Lib/javaos.py branches/Release_2_2maint/jython/Lib/pawt/swing.py branches/Release_2_2maint/jython/Lib/test/bugs/pr195.py branches/Release_2_2maint/jython/Lib/test/bugs/pr235.py branches/Release_2_2maint/jython/Lib/test/test_jbasic.py branches/Release_2_2maint/jython/Tools/freeze/Output.py branches/Release_2_2maint/jython/Tools/freeze/freeze.py branches/Release_2_2maint/jython/Tools/jythonc/ObjectFactory.py branches/Release_2_2maint/jython/Tools/jythonc/PythonModule.py branches/Release_2_2maint/jython/Tools/jythonc/compile.py branches/Release_2_2maint/jython/Tools/jythonc/jar.py branches/Release_2_2maint/jython/Tools/jythonc/jast/Output.py branches/Release_2_2maint/jython/Tools/jythonc/javac.py branches/Release_2_2maint/jython/Tools/jythonc/jythonc.py branches/Release_2_2maint/jython/Tools/jythonc/main.py branches/Release_2_2maint/jython/Tools/mkjava.py branches/Release_2_2maint/jython/src/com/ziclix/python/sql/DataHandler.java branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java branches/Release_2_2maint/jython/src/com/ziclix/python/sql/handler/MySQLDataHandler.java branches/Release_2_2maint/jython/src/org/python/core/FilelikeInputStream.java branches/Release_2_2maint/jython/src/org/python/core/Options.java branches/Release_2_2maint/jython/src/org/python/core/Py.java branches/Release_2_2maint/jython/src/org/python/core/PyArray.java branches/Release_2_2maint/jython/src/org/python/core/PyDictionary.java branches/Release_2_2maint/jython/src/org/python/core/PyFile.java branches/Release_2_2maint/jython/src/org/python/core/PyFunction.java branches/Release_2_2maint/jython/src/org/python/core/PyString.java branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java branches/Release_2_2maint/jython/src/org/python/core/PyTableCode.java branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java branches/Release_2_2maint/jython/src/org/python/core/StdoutWrapper.java branches/Release_2_2maint/jython/src/org/python/core/parser.java branches/Release_2_2maint/jython/src/org/python/modules/MD5Module.java branches/Release_2_2maint/jython/src/org/python/modules/SHA1.java branches/Release_2_2maint/jython/src/org/python/modules/Setup.java branches/Release_2_2maint/jython/src/org/python/modules/binascii.java branches/Release_2_2maint/jython/src/org/python/modules/imp.java branches/Release_2_2maint/jython/src/org/python/modules/time/Time.java branches/Release_2_2maint/jython/src/org/python/util/InteractiveInterpreter.java branches/Release_2_2maint/jython/src/org/python/util/PyServlet.java branches/Release_2_2maint/jython/src/org/python/util/PythonInterpreter.java Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437 + /trunk:1-3437,3471-3474,3479-3480 Modified: branches/Release_2_2maint/jython/Lib/javaos.py =================================================================== --- branches/Release_2_2maint/jython/Lib/javaos.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Lib/javaos.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -224,9 +224,9 @@ def popitem(self): self.__populate() return UserDict.popitem( self ) - def pop(self): + def pop(self, *args): self.__populate() - return UserDict.pop(self) + return UserDict.pop(self, *args) def iteritems(self): self.__populate() return UserDict.iteritems(self) Modified: branches/Release_2_2maint/jython/Lib/pawt/swing.py =================================================================== --- branches/Release_2_2maint/jython/Lib/pawt/swing.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Lib/pawt/swing.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -37,6 +37,6 @@ sys.modules['pawt.swing'] = swing swing.__dict__['test'] = test - #These two lines help out jpythonc to figure out this very strange module + #These two lines help out jythonc to figure out this very strange module swing.__dict__['__file__'] = __file__ swing.__dict__['__jpythonc_name__'] = 'pawt.swing' Modified: branches/Release_2_2maint/jython/Lib/test/bugs/pr195.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/bugs/pr195.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Lib/test/bugs/pr195.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -3,7 +3,7 @@ from javax.swing import AbstractListModel, ComboBoxModel # Note that AbstractListModel implements ListModel, ComboBoxModel extends -# ListModel. This would cause JPython to include +# ListModel. This would cause Jython to include # (Object)ListModel.getElementAt(int) twice in the proxy class, which is # illegal. Modified: branches/Release_2_2maint/jython/Lib/test/bugs/pr235.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/bugs/pr235.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Lib/test/bugs/pr235.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,4 +1,4 @@ -# PR#235, JPython crashes (i.e. uncaught Java exception) under strange +# PR#235, Jython crashes (i.e. uncaught Java exception) under strange # (illegal) input. bogus = '''\ Modified: branches/Release_2_2maint/jython/Lib/test/test_jbasic.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/test_jbasic.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Lib/test/test_jbasic.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -110,4 +110,4 @@ b1.doClick() assert flag == 1, 'one actions per event - again' -# TBD: JPython does not properly exit after this code! +# TBD: Jython does not properly exit after this code! Modified: branches/Release_2_2maint/jython/Tools/freeze/Output.py =================================================================== --- branches/Release_2_2maint/jython/Tools/freeze/Output.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/freeze/Output.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -84,9 +84,9 @@ pass if __name__ == '__main__': - for of in [CabOutput('c:\\jpython\\test.cab')]: #DirectoryOutput('c:\\jpython\\dtest'), ZipOutput('c:\\jpython\\test.jar')]: - of.write('org.python.core.PyInteger', 'c:\\jpython\\JavaCode\\org\\python\\core\\PyInteger.class') - of.write('org.python.core.PyFloat', 'c:\\jpython\\JavaCode\\org\\python\\core\\PyFloat.class') + for of in [CabOutput('c:\\jython\\test.cab')]: #DirectoryOutput('c:\\jython\\dtest'), ZipOutput('c:\\jython\\test.jar')]: + of.write('org.python.core.PyInteger', 'c:\\jython\\JavaCode\\org\\python\\core\\PyInteger.class') + of.write('org.python.core.PyFloat', 'c:\\jython\\JavaCode\\org\\python\\core\\PyFloat.class') bytes = ByteArrayOutputStream() bytes.write(jarray.array([10]*500, 'b')) of.write('hi.there', bytes) Modified: branches/Release_2_2maint/jython/Tools/freeze/freeze.py =================================================================== --- branches/Release_2_2maint/jython/Tools/freeze/freeze.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/freeze/freeze.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -108,7 +108,7 @@ f.finish(opts.main) if opts.core: - skiplist = ['org.python.core.parser', 'org.python.core.BytecodeLoader', 'org.python.core.jpython'] + skiplist = ['org.python.core.parser', 'org.python.core.BytecodeLoader', 'org.python.core.jython'] f.addPackage(os.path.join(sys.prefix, 'JavaCode', 'org', 'python', 'core'), skiplist) f.out.close() Modified: branches/Release_2_2maint/jython/Tools/jythonc/ObjectFactory.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/ObjectFactory.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/ObjectFactory.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -334,4 +334,4 @@ print mod.attributes.keys() print mod.imports.keys() print mod - mod.dump("c:\\jpython\\tools\\jpythonc2\\test") + mod.dump("c:\\jython\\tools\\jythonc2\\test") Modified: branches/Release_2_2maint/jython/Tools/jythonc/PythonModule.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/PythonModule.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/PythonModule.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -14,7 +14,7 @@ """ class foo - class py -- what gets imported by jpython + class py -- what gets imported by jython holds all py constants One of these no matter how many classes maybe have static inner classes as well @@ -478,4 +478,4 @@ pm.packages = ['java.lang', 'java.awt'] pm.getIntegerConstant(22) pm.getStringConstant("hello world") - pm.dump("c:\\jpython\\tools\\jpythonc2") + pm.dump("c:\\jython\\tools\\jythonc2") Modified: branches/Release_2_2maint/jython/Tools/jythonc/compile.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/compile.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/compile.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -480,5 +480,5 @@ ja = JavaArchive([('org.python.core', []),]) for jc in javaclasses: ja.addClass(outdir, jc) - outjar = "c:\\jpython\\tools\\jpythonc2\\test\\t.jar" + outjar = "c:\\jython\\tools\\jythonc2\\test\\t.jar" ja.dump(outjar) Modified: branches/Release_2_2maint/jython/Tools/jythonc/jar.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/jar.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/jar.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -165,7 +165,7 @@ if __name__ == '__main__': - root = "c:\\jpython\\tools\\jpythonc2" + root = "c:\\jython\\tools\\jythonc2" ja = JavaArchive() ja.addFile(root, "jar.py") ja.addFile(root, "proxies.py") Modified: branches/Release_2_2maint/jython/Tools/jythonc/jast/Output.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/jast/Output.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/jast/Output.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -13,7 +13,7 @@ self.classname = classname self.filename = classname+'.java' - def dump(self, directory="c:\\jpython\\test\\comp"): + def dump(self, directory="c:\\jython\\test\\comp"): fp = open(os.path.join(directory, self.filename), 'w') for bit in self.text: fp.write(bit) Modified: branches/Release_2_2maint/jython/Tools/jythonc/javac.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/javac.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/javac.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -109,8 +109,8 @@ if __name__ == '__main__': - files = ["c:\\jpython\\tools\\jpythonc2\\test\\ButtonDemo.java", - "c:\\jpython\\tools\\jpythonc2\\test\\pawt.java",] + files = ["c:\\jython\\tools\\jythonc2\\test\\ButtonDemo.java", + "c:\\jython\\tools\\jythonc2\\test\\pawt.java",] print compile(files) print compile(files, ["-foo", "bar"]) Modified: branches/Release_2_2maint/jython/Tools/jythonc/jythonc.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/jythonc.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/jythonc.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,6 +1,6 @@ # Copyright (c) Corporation for National Research Initiatives -# Driver script for jpythonc2. See module main.py for details +# Driver script for jythonc2. See module main.py for details import main main.main() Modified: branches/Release_2_2maint/jython/Tools/jythonc/main.py =================================================================== --- branches/Release_2_2maint/jython/Tools/jythonc/main.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/jythonc/main.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,6 +1,6 @@ # Copyright (c) Corporation for National Research Initiatives -"""Usage: jpythonc [options] [module]* +"""Usage: jythonc [options] [module]* where options include: @@ -22,11 +22,11 @@ --core -c - Include the core JPython libraries (implies --deep) + Include the core Jython libraries (implies --deep) --all -a - Include all of the JPython libraries (implies --deep) + Include all of the Jython libraries (implies --deep) --bean jarfile -b jarfile @@ -49,12 +49,12 @@ -C path Use a different compiler than `standard' javac. If this is set to `NONE' then compile ends with .java. Alternatively, you can set the - property python.jpythonc.compiler in the registry. + property python.jythonc.compiler in the registry. --compileropts options -J options Options passed directly to the Java compiler. Alternatively, you can - set the property python.jpythonc.compileropts in the registry. + set the property python.jythonc.compileropts in the registry. --falsenames names -f names Modified: branches/Release_2_2maint/jython/Tools/mkjava.py =================================================================== --- branches/Release_2_2maint/jython/Tools/mkjava.py 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/Tools/mkjava.py 2007-09-19 11:09:34 UTC (rev 3484) @@ -22,7 +22,7 @@ if __name__ == '__main__': if len(sys.argv) != 4: - print 'usage: jpython mkjava.py java_name python_name directory' + print 'usage: jython mkjava.py java_name python_name directory' sys.exit(-1) directory = sys.argv[-1] Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/DataHandler.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/DataHandler.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/DataHandler.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -250,7 +250,7 @@ byte[] bytes = DataHandler.read(longvarchar); if (bytes != null) { - obj = Py.newString(new String(bytes)); + obj = Py.newString(PyString.from_bytes(bytes)); } } finally { try { Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -66,7 +66,7 @@ String clob = (String) object.__tojava__(String.class); int length = clob.length(); - InputStream stream = new ByteArrayInputStream(clob.getBytes()); + InputStream stream = new ByteArrayInputStream(PyString.to_bytes(clob)); stream = new BufferedInputStream(stream); Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/handler/MySQLDataHandler.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/handler/MySQLDataHandler.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/handler/MySQLDataHandler.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -11,6 +11,7 @@ import com.ziclix.python.sql.DataHandler; import org.python.core.PyFile; import org.python.core.PyObject; +import org.python.core.PyString; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -59,7 +60,7 @@ } else { varchar = (String) object.__tojava__(String.class); } - InputStream stream = new ByteArrayInputStream(varchar.getBytes()); + InputStream stream = new ByteArrayInputStream(PyString.to_bytes(varchar)); stream = new BufferedInputStream(stream); Modified: branches/Release_2_2maint/jython/src/org/python/core/FilelikeInputStream.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/FilelikeInputStream.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/FilelikeInputStream.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -34,7 +34,7 @@ if(result.length() == 0) { return -1; } - System.arraycopy(result.getBytes(), 0, b, off, result.length()); + System.arraycopy(PyString.to_bytes(result), 0, b, off, result.length()); return result.length(); } Modified: branches/Release_2_2maint/jython/src/org/python/core/Options.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/Options.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/Options.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -8,7 +8,7 @@ */ public class Options { // Jython options. Some of these can be set from the command line - // options, but all can be controlled through the JPython registry + // options, but all can be controlled through the Jython registry /** * when an exception occurs in Java code, and it is not caught, should the @@ -38,7 +38,7 @@ public static boolean pollStandardIn = false; /** - * If true, JPython respects Java the accessibility flag for fields, + * If true, Jython respects Java the accessibility flag for fields, * methods, and constructors. This means you can only access public members. * Set this to false to access all members by toggling the accessible flag * on the member. Modified: branches/Release_2_2maint/jython/src/org/python/core/Py.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/Py.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/Py.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,6 +1,7 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.core; +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -1698,12 +1699,14 @@ cflags); } - public static PyCode compile_flags(String data, String filename, - String type,CompilerFlags cflags) - { - return Py.compile_flags( - new java.io.ByteArrayInputStream((data+"\n\n").getBytes()), - filename, type,cflags); + public static PyCode compile_flags(String data, + String filename, + String type, + CompilerFlags cflags) { + return Py.compile_flags(new ByteArrayInputStream(PyString.to_bytes(data + "\n\n")), + filename, + type, + cflags); } public static PyObject compile_command_flags(String string, Modified: branches/Release_2_2maint/jython/src/org/python/core/PyArray.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyArray.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyArray.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1272,7 +1272,7 @@ if((strlen % itemsize) != 0) { throw Py.ValueError("string length not a multiple of item size"); } - ByteArrayInputStream bis = new ByteArrayInputStream(input.getBytes()); + ByteArrayInputStream bis = new ByteArrayInputStream(PyString.to_bytes(input)); int origsize = delegate.getSize(); try { fromStream(bis); @@ -1676,7 +1676,7 @@ delegate.replaceSubArray(chars, start); } else { if(value instanceof PyString && type == Byte.TYPE) { - byte[] chars = value.toString().getBytes(); + byte[] chars = ((PyString)value).getBytes(); if(chars.length == stop - start && step == 1) { System.arraycopy(chars, 0, data, start, chars.length); } else { @@ -1726,8 +1726,7 @@ throw Py.TypeError("file needs to be in write or append mode"); } // write via the PyFile - String buffer = tostring(); - file.write(buffer); + file.write(tostring()); } public PyObject array_tolist(){ @@ -1806,12 +1805,6 @@ } catch(IOException e) { throw Py.IOError(e); } - try { - // The returned string is used as a Python str with values - // from 0-255. iso-8859-1 maps the byte values into that range. - return new String(bos.toByteArray(), "iso-8859-1"); - } catch (UnsupportedEncodingException e) { - throw Py.JavaError(e); - } + return PyString.from_bytes(bos.toByteArray()); } } Modified: branches/Release_2_2maint/jython/src/org/python/core/PyDictionary.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyDictionary.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyDictionary.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -899,6 +899,10 @@ return table.containsKey(key); } + public boolean __contains__(PyObject o) { + return dict___contains__(o); + } + final boolean dict___contains__(PyObject o) { return dict_has_key(o); } Modified: branches/Release_2_2maint/jython/src/org/python/core/PyFile.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyFile.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyFile.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,11 +1,15 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.core; +import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.PushbackInputStream; +import java.io.RandomAccessFile; +import java.io.Writer; import java.util.LinkedList; // To do: @@ -32,66 +36,48 @@ mode.indexOf('a') >= 0; binary = mode.indexOf('b') >= 0; } - public String read(int n) throws java.io.IOException { - throw new java.io.IOException("file not open for reading"); + public String read(int n) throws IOException { + throw new IOException("file not open for reading"); } - public int read() throws java.io.IOException { - throw new java.io.IOException("file not open for reading"); + public int read() throws IOException { + throw new IOException("file not open for reading"); } - public int available() throws java.io.IOException { - throw new java.io.IOException("file not open for reading"); + public int available() throws IOException { + throw new IOException("file not open for reading"); } - public void unread(int c) throws java.io.IOException { - throw new java.io.IOException("file doesn't support unread"); + public void unread(int c) throws IOException { + throw new IOException("file doesn't support unread"); } - public void write(String s) throws java.io.IOException { - throw new java.io.IOException("file not open for writing"); + public void write(String s) throws IOException { + throw new IOException("file not open for writing"); } - public long tell() throws java.io.IOException { - throw new java.io.IOException("file doesn't support tell/seek"); + public long tell() throws IOException { + throw new IOException("file doesn't support tell/seek"); } - public void seek(long pos, int how) throws java.io.IOException { - throw new java.io.IOException("file doesn't support tell/seek"); + public void seek(long pos, int how) throws IOException { + throw new IOException("file doesn't support tell/seek"); } - public void flush() throws java.io.IOException { + public void flush() throws IOException { } - public void close() throws java.io.IOException { + public void close() throws IOException { } - public void truncate(long position) throws java.io.IOException { - throw new java.io.IOException("file doesn't support truncate"); + public void truncate(long position) throws IOException { + throw new IOException("file doesn't support truncate"); } public Object __tojava__(Class cls) throws IOException { return null; } - protected byte[] getBytes(String s) { - // Yes, I known the method is depricated, but it is the fastest - // way of converting between between byte[] and String - if (binary) { - byte[] buf = new byte[s.length()]; - s.getBytes(0, s.length(), buf, 0); - return buf; - } else - return s.getBytes(); - } - protected String getString(byte[] buf, int offset, int len) { - // Yes, I known the method is depricated, but it is the fastest - // way of converting between between byte[] and String - if (binary) { - return new String(buf, 0, offset, len); - } else - return new String(buf, offset, len); - } } private static class InputStreamWrapper extends FileWrapper { - java.io.InputStream istream; + InputStream istream; - public InputStreamWrapper(java.io.InputStream s) { + public InputStreamWrapper(InputStream s) { istream = s; } - public String read(int n) throws java.io.IOException { + public String read(int n) throws IOException { if (n == 0) // nothing to do return ""; @@ -100,7 +86,7 @@ byte buf[] = new byte[1024]; StringBuffer sbuf = new StringBuffer(); for (int read=0; read >= 0; read=istream.read(buf)) - sbuf.append(getString(buf, 0, read)); + sbuf.append(PyString.from_bytes(buf, 0, read)); return sbuf.toString(); } // read the next chunk available, but make sure it's at least @@ -113,22 +99,22 @@ if (read < 0) // EOF encountered return ""; - return new String(buf, 0, 0, read); + return PyString.from_bytes(buf, 0, read); } - public int read() throws java.io.IOException { + public int read() throws IOException { return istream.read(); } - public int available() throws java.io.IOException { + public int available() throws IOException { return istream.available(); } - public void unread(int c) throws java.io.IOException { - ((java.io.PushbackInputStream)istream).unread(c); + public void unread(int c) throws IOException { + ((PushbackInputStream)istream).unread(c); } - public void close() throws java.io.IOException { + public void close() throws IOException { istream.close(); } @@ -140,16 +126,16 @@ } private static class OutputStreamWrapper extends FileWrapper { - private java.io.OutputStream ostream; + private OutputStream ostream; - public OutputStreamWrapper(java.io.OutputStream s) { + public OutputStreamWrapper(OutputStream s) { ostream = s; } private static final int MAX_WRITE = 30000; - public void write(String s) throws java.io.IOException { - byte[] bytes = getBytes(s); + public void write(String s) throws IOException { + byte[] bytes = PyString.to_bytes(s); int n = bytes.length; int i = 0; while (i < n) { @@ -160,11 +146,11 @@ } } - public void flush() throws java.io.IOException { + public void flush() throws IOException { ostream.flush(); } - public void close() throws java.io.IOException { + public void close() throws IOException { ostream.close(); } @@ -176,23 +162,23 @@ } private static class IOStreamWrapper extends InputStreamWrapper { - private java.io.OutputStream ostream; + private OutputStream ostream; - public IOStreamWrapper(java.io.InputStream istream, - java.io.OutputStream ostream) { + public IOStreamWrapper(InputStream istream, + OutputStream ostream) { super(istream); this.ostream = ostream; } - public void write(String s) throws java.io.IOException { - ostream.write(getBytes(s)); + public void write(String s) throws IOException { + ostream.write(PyString.to_bytes(s)); } - public void flush() throws java.io.IOException { + public void flush() throws IOException { ostream.flush(); } - public void close() throws java.io.IOException { + public void close() throws IOException { ostream.close(); istream.close(); } @@ -205,23 +191,23 @@ } private static class WriterWrapper extends FileWrapper { - private java.io.Writer writer; + private Writer writer; - public WriterWrapper(java.io.Writer s) { + public WriterWrapper(Writer s) { writer = s; } //private static final int MAX_WRITE = 30000; - public void write(String s) throws java.io.IOException { + public void write(String s) throws IOException { writer.write(s); } - public void flush() throws java.io.IOException { + public void flush() throws IOException { writer.flush(); } - public void close() throws java.io.IOException { + public void close() throws IOException { writer.close(); } } @@ -230,8 +216,8 @@ /** The default buffer size, in bytes. */ protected static final int defaultBufferSize = 4096; - /** The underlying java.io.RandomAccessFile. */ - protected java.io.RandomAccessFile file; + /** The underlying RandomAccessFile. */ + protected RandomAccessFile file; /** The offset in bytes from the file start, of the next read or * write operation. */ @@ -260,11 +246,11 @@ /** True if the data in the buffer has been modified. */ boolean bufferModified = false; - public RFileWrapper(java.io.RandomAccessFile file) { + public RFileWrapper(RandomAccessFile file) { this(file, 8092); } - public RFileWrapper(java.io.RandomAccessFile file, int bufferSize) { + public RFileWrapper(RandomAccessFile file, int bufferSize) { this.file = file; bufferStart = 0; dataEnd = 0; @@ -274,7 +260,7 @@ endOfFile = false; } - public String read(int n) throws java.io.IOException { + public String read(int n) throws IOException { if (n < 0) { n = (int)(file.length() - filePosition); if (n < 0) @@ -284,7 +270,7 @@ n = readBytes(buf, 0, n); if (n < 0) n = 0; - return getString(buf, 0, n); + return PyString.from_bytes(buf, 0, n); } @@ -346,7 +332,7 @@ } - public int read() throws java.io.IOException { + public int read() throws IOException { // If the file position is within the data, return the byte... if (filePosition < dataEnd) { return (int)(buffer[(int)(filePosition++ - bufferStart)] @@ -361,16 +347,16 @@ } } - public int available() throws java.io.IOException { + public int available() throws IOException { return 1; } - public void unread(int c) throws java.io.IOException { + public void unread(int c) throws IOException { filePosition--; } - public void write(String s) throws java.io.IOException { - byte[] b = getBytes(s); + public void write(String s) throws IOException { + byte[] b = PyString.to_bytes(s); int len = b.length; // If the amount of data is small (less than a full buffer)... @@ -421,11 +407,11 @@ } } - public long tell() throws java.io.IOException { + public long tell() throws IOException { return filePosition; } - public void seek(long pos, int how) throws java.io.IOException { + public void seek(long pos, int how) throws IOException { if (how == 1) pos += filePosition; else if (how == 2) @@ -462,14 +448,14 @@ dataEnd = bufferStart + dataSize; } - public void flush() throws java.io.IOException { + public void flush() throws IOException { file.seek(bufferStart); file.write(buffer, 0, dataSize); bufferModified = false; file.getFD().sync(); } - public void close() throws java.io.IOException { + public void close() throws IOException { if (writing && bufferModified) { file.seek(bufferStart); file.write(buffer, 0, (int)dataSize); @@ -478,7 +464,7 @@ file.close(); } - public void truncate(long position) throws java.io.IOException { + public void truncate(long position) throws IOException { flush(); try { // file.setLength(position); @@ -519,7 +505,7 @@ sep_is_nl = (sep == "\n"); } - public String read(int n) throws java.io.IOException { + public String read(int n) throws IOException { String s = this.file.read(n); int index = s.indexOf('\r'); if (index < 0) @@ -544,7 +530,7 @@ return buf.toString(); } - public int read() throws java.io.IOException { + public int read() throws IOException { int c = file.read(); if (c != '\r') return c; @@ -556,7 +542,7 @@ return '\n'; } - public void write(String s) throws java.io.IOException { + public void write(String s) throws IOException { if (!sep_is_nl) { int index = s.indexOf('\n'); if (index >= 0) { @@ -575,23 +561,23 @@ this.file.write(s); } - public long tell() throws java.io.IOException { + public long tell() throws IOException { return file.tell(); } - public void seek(long pos, int how) throws java.io.IOException { + public void seek(long pos, int how) throws IOException { file.seek(pos, how); } - public void flush() throws java.io.IOException { + public void flush() throws IOException { file.flush(); } - public void close() throws java.io.IOException { + public void close() throws IOException { file.close(); } - public void truncate(long position) throws java.io.IOException { + public void truncate(long position) throws IOException { file.truncate(position); } @@ -1082,13 +1068,13 @@ private FileWrapper file; - private static java.io.InputStream _pb(java.io.InputStream s, String mode) + private static InputStream _pb(InputStream s, String mode) { if (mode.indexOf('b') < 0) { - if(s instanceof java.io.PushbackInputStream) { + if(s instanceof PushbackInputStream) { return s; } - return new java.io.PushbackInputStream(s); + return new PushbackInputStream(s); } return s; } @@ -1127,67 +1113,67 @@ } } - public PyFile(java.io.InputStream istream, java.io.OutputStream ostream, + public PyFile(InputStream istream, OutputStream ostream, String name, String mode) { this(new IOStreamWrapper(_pb(istream, mode), ostream), name, mode); } - public PyFile(java.io.InputStream istream, java.io.OutputStream ostream, + public PyFile(InputStream istream, OutputStream ostream, String name) { this(istream, ostream, name, "r+"); } - public PyFile(java.io.InputStream istream, java.io.OutputStream ostream) { + public PyFile(InputStream istream, OutputStream ostream) { this(istream, ostream, "<???>", "r+"); } - public PyFile(java.io.InputStream istream, String name, String mode) { + public PyFile(InputStream istream, String name, String mode) { this(new InputStreamWrapper(_pb(istream, mode)), name, mode); } - public PyFile(java.io.InputStream istream, String name) { + public PyFile(InputStream istream, String name) { this(istream, name, "r"); } - public PyFile(java.io.InputStream istream) { + public PyFile(InputStream istream) { this(istream, "<???>", "r"); } - public PyFile(java.io.OutputStream ostream, String name, String mode) { + public PyFile(OutputStream ostream, String name, String mode) { this(new OutputStreamWrapper(ostream), name, mode); } - public PyFile(java.io.OutputStream ostream, String name) { + public PyFile(OutputStream ostream, String name) { this(ostream, name, "w"); } - public PyFile(java.io.OutputStream ostream) { + public PyFile(OutputStream ostream) { this(ostream, "<???>", "w"); } - public PyFile(java.io.Writer ostream, String name, String mode) { + public PyFile(Writer ostream, String name, String mode) { this(new WriterWrapper(ostream), name, mode); } - public PyFile(java.io.Writer ostream, String name) { + public PyFile(Writer ostream, String name) { this(ostream, name, "w"); } - public PyFile(java.io.Writer ostream) { + public PyFile(Writer ostream) { this(ostream, "<???>", "w"); } - public PyFile(java.io.RandomAccessFile file, String name, String mode) { + public PyFile(RandomAccessFile file, String name, String mode) { this(new RFileWrapper(file), name, mode); } - public PyFile(java.io.RandomAccessFile file, String name) { + public PyFile(RandomAccessFile file, String name) { this(file, name, "r+"); } - public PyFile(java.io.RandomAccessFile file) { + public PyFile(RandomAccessFile file) { this(file, "<???>", "r+"); } @@ -1209,7 +1195,7 @@ Object o = null; try { o = file.__tojava__(cls); - } catch (java.io.IOException exc) { } + } catch (IOException exc) { } if (o == null) o = super.__tojava__(cls); return o; @@ -1239,27 +1225,27 @@ } else if (c1 == 'w' || c1 == 'a') jmode = "rw"; try { - java.io.File f = new java.io.File(name); + File f = new File(name); if (c1 == 'r') { if (!f.exists()) { - throw new java.io.IOException("No such file or directory: " + name); + throw new IOException("No such file or directory: " + name); } } if (c1 == 'w') { // Hack to truncate the file without deleting it: // create a FileOutputStream for it and close it again. - java.io.FileOutputStream fo = new java.io.FileOutputStream(f); + FileOutputStream fo = new FileOutputStream(f); fo.close(); fo = null; } // What about bufsize? - java.io.RandomAccessFile rfile = - new java.io.RandomAccessFile(f, jmode); + RandomAccessFile rfile = + new RandomAccessFile(f, jmode); RFileWrapper iofile = new RFileWrapper(rfile); if (c1 == 'a') iofile.seek(0, 2); return iofile; - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1281,7 +1267,7 @@ break; } } - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } return data.toString(); @@ -1307,7 +1293,7 @@ int c; try { c = file.read(); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } if (c < 0) @@ -1406,7 +1392,7 @@ try { file.write(s); softspace = false; - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1436,7 +1422,7 @@ err_closed(); try { return file.tell(); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1450,7 +1436,7 @@ err_closed(); try { file.seek(pos, how); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1472,7 +1458,7 @@ err_closed(); try { file.flush(); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1488,7 +1474,7 @@ } else { try { file.close(); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1503,7 +1489,7 @@ final void file_truncate() { try { file.truncate(file.tell()); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1515,7 +1501,7 @@ final void file_truncate(long position) { try { file.truncate(position); - } catch (java.io.IOException e) { + } catch (IOException e) { throw Py.IOError(e); } } @@ -1527,7 +1513,7 @@ // TBD: should this be removed? I think it's better to raise an // AttributeError than an IOError here. public PyObject fileno() { - throw Py.IOError("fileno() is not supported in jpython"); + throw Py.IOError("fileno() is not supported in jython"); } final String file_toString() { @@ -1616,7 +1602,7 @@ public void _close(){ try { fw.close(); - } catch(java.io.IOException e) { + } catch(IOException e) { throw Py.IOError(e); } finally { fw = null; @@ -1654,6 +1640,4 @@ } } } - - } Modified: branches/Release_2_2maint/jython/src/org/python/core/PyFunction.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyFunction.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyFunction.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -78,7 +78,7 @@ public void __setattr__(String name, PyObject value) { // TBD: in CPython, func_defaults, func_doc, __doc__ are // writable. For now, only func_doc, __doc__ are writable in - // JPython. + // Jython. if (name == "func_doc" || name == "__doc__") __doc__ = value; else if (name == "func_closure") { Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -2001,21 +2001,41 @@ return cached_hashcode; } - private byte[] getBytes() { - return to_bytes(string); + /** + * @return a byte array with one byte for each char in this object's + * underlying String. Each byte contains the low-order bits of its + * corresponding char. + */ + public byte[] getBytes() { + return to_bytes(string); } + + /** + * @return a byte array with one byte for each char in s. Each byte contains + * the low-order bits of its corresponding char. + */ + public static byte[] to_bytes(String s) { + int len = s.length(); + byte[] b = new byte[len]; + s.getBytes(0, len, b, 0); + return b; + } + + /** + * @return A String with chars corresponding to the bytes in buf + */ + public static String from_bytes(byte[] buf) { + return from_bytes(buf, 0, buf.length); + } - public static byte[] to_bytes(String s){ - byte[] bytes = new byte[s.length()]; - for(int i = 0; i < bytes.length; i++) { - char c = s.charAt(i); - if(c < 256){ - bytes[i] = (byte)c; - }else{ - throw Py.ValueError("Strings added to sha hashes must not contain characters with value > 255"); - } - } - return bytes; + /** + * @return A String of len buff with chars corresponding to buf from off to + * off + len + */ + public static String from_bytes(byte[] buf, int off, int len) { + // Yes, I known the method is deprecated, but it is the fastest + // way of converting between between byte[] and String + return new String(buf, 0, off, len); } public Object __tojava__(Class c) { @@ -3093,7 +3113,7 @@ if (i > 0){ buf.append(string); } - buf.append(obj.__str__()); + buf.append(((PyString)obj).string); } if(needsUnicode || this instanceof PyUnicode){ return new PyUnicode(buf.toString()); Modified: branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -464,7 +464,7 @@ standalone = isStandalone(jarFileName); } - // initialize the JPython registry + // initialize the Jython registry initRegistry(preProperties, postProperties, standalone, jarFileName); // other initializations Modified: branches/Release_2_2maint/jython/src/org/python/core/PyTableCode.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyTableCode.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyTableCode.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -169,7 +169,7 @@ // Handle trace function for debugging PySystemState ss = ts.systemState; if (ss.tracefunc != null) { - // JPython and CPython differ here. CPython actually lays down + // Jython and CPython differ here. CPython actually lays down // an extra SET_LINENO bytecode for function definition line. // This is ostensibly so that a tuple unpacking failure in // argument passing gets the right line number in the @@ -177,7 +177,7 @@ // you'll see two 'line' events, one for the def line and then // immediately after, one for the first line of the function. // - // JPython on the other hand only lays down a call in the + // Jython on the other hand only lays down a call in the // generated Java function to set the line number for the first // line of the function (i.e. not the def line). This // difference in behavior doesn't seem to affect arg tuple Modified: branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1473,7 +1473,7 @@ return new PyUnicode(""); } if (S instanceof PyUnicode) { - return S; + return new PyUnicode(((PyUnicode)S).string); } if (S instanceof PyString) { return new PyUnicode(codecs.decode((PyString)S, encoding, errors)); @@ -1512,7 +1512,7 @@ } public PyString unicode___str__() { - return new PyString(toString()); + return new PyString(encode()); } final int unicode___len__() { Modified: branches/Release_2_2maint/jython/src/org/python/core/StdoutWrapper.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/StdoutWrapper.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/StdoutWrapper.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -71,7 +71,7 @@ } public void write(byte[] data, int off, int len) { - write(new String(data, off, len)); + write(PyString.from_bytes(data, off, len)); } public void clearSoftspace() { Modified: branches/Release_2_2maint/jython/src/org/python/core/parser.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/parser.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/core/parser.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,9 +1,23 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.core; -import org.python.parser.*; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.FilterReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; + +import org.python.parser.IParserHost; +import org.python.parser.Node; +import org.python.parser.ParseException; +import org.python.parser.PythonGrammar; +import org.python.parser.ReaderCharStream; +import org.python.parser.Token; +import org.python.parser.TokenMgrError; import org.python.parser.ast.modType; -import java.io.*; /** * Facade for the classes in the org.python.parser package. @@ -75,7 +89,7 @@ public static Node parse(String string, String kind) { - return parse(new ByteArrayInputStream(string.getBytes()), + return parse(new ByteArrayInputStream(PyString.to_bytes(string)), kind, "<string>", null); } @@ -103,7 +117,7 @@ modType node = null; //System.err.println(new PyString(string).__repr__().toString()); - BufferedReader bufreader = prepBufreader(new ByteArrayInputStream(string.getBytes()), + BufferedReader bufreader = prepBufreader(new ByteArrayInputStream(PyString.to_bytes(string)), cflags); PythonGrammar g = new PythonGrammar(new ReaderCharStream(bufreader), Modified: branches/Release_2_2maint/jython/src/org/python/modules/MD5Module.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/MD5Module.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/MD5Module.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -1,6 +1,6 @@ // Copyright (c) Corporation for National Research Initiatives -// This is a JPython module wrapper around Harry Mantakos' md.java class, +// This is a Jython module wrapper around Harry Mantakos' md.java class, // which provides the basic MD5 algorithm. See also MD5Object.java which // is the implementation of the md5 object returned by new() and md.java // which provides the md5 implementation. Modified: branches/Release_2_2maint/jython/src/org/python/modules/SHA1.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/SHA1.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/SHA1.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -492,12 +492,7 @@ ); public String digest() { - byte[] digestBits = engineDigest(); - try { - return new String(digestBits, "ISO-8859-1"); - } catch (UnsupportedEncodingException exc) { - throw Py.ValueError("encoding not supported"); - } + return PyString.from_bytes(engineDigest()); } // XXX should become PyObject and use Py.idstr? Modified: branches/Release_2_2maint/jython/src/org/python/modules/Setup.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/Setup.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/Setup.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -21,7 +21,7 @@ // The module `name' is removed from the list of builtin modules // // That isn't very useful here, but you can add additional builtin - // modules by editing the JPython registry file. See the property + // modules by editing the Jython registry file. See the property // python.modules.builtin for details. public static String[] builtinModules = { Modified: branches/Release_2_2maint/jython/src/org/python/modules/binascii.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/binascii.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/binascii.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -189,8 +189,7 @@ }; private static byte[] table_b2a_hqx = - "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr". - getBytes(); + PyString.to_bytes("!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr"); @@ -212,8 +211,7 @@ private static int BASE64_MAXBIN = 57; private static byte[] table_b2a_base64 = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". - getBytes(); + PyString.to_bytes("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); Modified: branches/Release_2_2maint/jython/src/org/python/modules/imp.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/imp.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/imp.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -19,7 +19,7 @@ * A bogus implementation of the CPython builtin module "imp". * Only the functions required by IDLE and PMW are implemented. * Luckily these function are also the only function that IMO can - * be implemented under JPython. + * be implemented under Jython. */ public class imp { Modified: branches/Release_2_2maint/jython/src/org/python/modules/time/Time.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/modules/time/Time.java 2007-09-19 10:48:52 UTC (rev 3483) +++ branches/Release_2_2maint/jython/src/org/python/modules/time/Time.java 2007-09-19 11:09:34 UTC (rev 3484) @@ -565,7 +565,7 @@ // properties and is "en_US" by default, at least around // here! Locale "en_US" differs from locale "C" in the way // it represents dates and times. Eventually we might want - // to craft a "C" locale for Java and set JPython to use + // to craft a "C" locale for Java and set Jython to use // this by default, but that's too much work right now. // // For now, we hard code %x and %X to return values Modified: branches/Release_2_2maint/jython/src/org/python/util/InteractiveInterpreter.java ========================================... [truncated message content] |
From: <pj...@us...> - 2007-09-20 01:34:31
|
Revision: 3486 http://jython.svn.sourceforge.net/jython/?rev=3486&view=rev Author: pjenvey Date: 2007-09-19 18:34:30 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Partially merge r3394 by hand from trunk (originally from branches/2.3) Merged revisions 3458,3461,3466-3467 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3394 | cgroves | 2007-08-05 14:10:04 -0700 (Sun, 05 Aug 2007) | 3 lines Fall back to o.__rmul__(this) if this.__imul__(o) fails. ........ r3458 | pjenvey | 2007-08-30 17:29:01 -0700 (Thu, 30 Aug 2007) | 5 lines o add PyLong.asInt, with bounds checking. allows longs passed in for built in types' int arguments to work o fix typo in PyLong's OverflowError message Patch: #1784564 ........ r3461 | pjenvey | 2007-08-31 14:46:13 -0700 (Fri, 31 Aug 2007) | 8 lines fix some binary op bugs on str/unicode/list/tuple types: o [r]add/mul and mod weren't exposed as binary ops and threw their own TypeErrors, disallowing _binop_rule from trying __rxxx__ methods when __xxx__ failed o cleanup the associated TypeError error messages, match them to CPython 2.5.1 o test these ops in test_descr patch: #1775078 ........ r3466 | pjenvey | 2007-09-02 19:08:54 -0700 (Sun, 02 Sep 2007) | 6 lines o force remapping of the ReadlineConsole tab key to inserting an actual tab, like CPython does, as readline defaults tab to its completion function o prefer importing to using fully qualified names references patch #795831 thanks Ben Burton ........ r3467 | pjenvey | 2007-09-02 19:26:39 -0700 (Sun, 02 Sep 2007) | 3 lines parseAndBind is only supported by pure readline, catch a potential exception raised when the readline implementation doesn't support it ........ Modified Paths: -------------- branches/Release_2_2maint/jython/Lib/test/test_descr.py branches/Release_2_2maint/jython/src/org/python/core/PyList.java branches/Release_2_2maint/jython/src/org/python/core/PyLong.java branches/Release_2_2maint/jython/src/org/python/core/PySequence.java branches/Release_2_2maint/jython/src/org/python/core/PyString.java branches/Release_2_2maint/jython/src/org/python/core/PyTuple.java branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java branches/Release_2_2maint/jython/src/org/python/util/ReadlineConsole.java branches/Release_2_2maint/jython/src/templates/list.expose branches/Release_2_2maint/jython/src/templates/str.expose branches/Release_2_2maint/jython/src/templates/tuple.expose branches/Release_2_2maint/jython/src/templates/unicode.expose Added Paths: ----------- branches/Release_2_2maint/jython/Lib/test/test_long_int_args.py Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3471-3474,3479-3480 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480 Modified: branches/Release_2_2maint/jython/Lib/test/test_descr.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/test_descr.py 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/Lib/test/test_descr.py 2007-09-20 01:34:30 UTC (rev 3486) @@ -3909,6 +3909,71 @@ except RuntimeError: pass +def subclass_binop(): + if verbose: + print "Testing binary ops with subclasses" + + def raises(exc, expected, callable, *args): + try: + callable(*args) + except exc, msg: + if str(msg) != expected: + raise TestFailed, "Message %r, expected %r" % (str(msg), + expected) + else: + raise TestFailed, "Expected %s" % exc + + class B(object): + pass + + class C(object): + def __radd__(self, o): + return '%r + C()' % (o,) + + def __rmul__(self, o): + return '%r * C()' % (o,) + + # Test strs, unicode, lists and tuples + mapping = [] + + # + binop + mapping.append((lambda o: 'foo' + o, + TypeError, "cannot concatenate 'str' and 'B' objects", + "'foo' + C()")) + # XXX: There's probably work to be done here besides just emulating this + # message + #mapping.append((lambda o: u'foo' + o, + # TypeError, + # 'coercing to Unicode: need string or buffer, B found', + # "u'foo' + C()")) + mapping.append((lambda o: u'foo' + o, + TypeError, "cannot concatenate 'unicode' and 'B' objects", + "u'foo' + C()")) + mapping.append((lambda o: [1, 2] + o, + TypeError, 'can only concatenate list (not "B") to list', + '[1, 2] + C()')) + mapping.append((lambda o: ('foo', 'bar') + o, + TypeError, 'can only concatenate tuple (not "B") to tuple', + "('foo', 'bar') + C()")) + + # * binop + mapping.append((lambda o: 'foo' * o, + TypeError, "can't multiply sequence by non-int of type 'B'", + "'foo' * C()")) + mapping.append((lambda o: u'foo' * o, + TypeError, "can't multiply sequence by non-int of type 'B'", + "u'foo' * C()")) + mapping.append((lambda o: [1, 2] * o, + TypeError, "can't multiply sequence by non-int of type 'B'", + '[1, 2] * C()')) + mapping.append((lambda o: ('foo', 'bar') * o, + TypeError, "can't multiply sequence by non-int of type 'B'", + "('foo', 'bar') * C()")) + + for func, bexc, bexc_msg, cresult in mapping: + raises(bexc, bexc_msg, lambda : func(B())) + vereq(func(C()), cresult) + def test_main(): testfuncs = [ weakref_segfault, # Must be first, somehow @@ -3998,6 +4063,7 @@ proxysuper, carloverre, filefault, + subclass_binop, ] if __name__ == '__main__': import sys Copied: branches/Release_2_2maint/jython/Lib/test/test_long_int_args.py (from rev 3458, trunk/jython/Lib/test/test_long_int_args.py) =================================================================== --- branches/Release_2_2maint/jython/Lib/test/test_long_int_args.py (rev 0) +++ branches/Release_2_2maint/jython/Lib/test/test_long_int_args.py 2007-09-20 01:34:30 UTC (rev 3486) @@ -0,0 +1,61 @@ +"""Ensure longs passed to int arguments are handled correctly + +Made for Jython. +""" +import array +import cStringIO +import tempfile +import test_support +import unittest +import StringIO + +class LongIntArgsTestCase(unittest.TestCase): + + def test_array(self): + a = array.array('c', 'jython') + assert a.pop(0L) == 'j' + + def test_file(self): + test_file = tempfile.TemporaryFile() + try: + self._test_file(test_file) + finally: + test_file.close() + + def test_StringIO(self): + self._test_file(StringIO.StringIO()) + + def test_cStringIO(self): + self._test_file(cStringIO.StringIO()) + + def test_str(self): + self._test_basestring(str) + + def test_unicode(self): + self._test_basestring(unicode) + + def _test_basestring(self, class_): + s = class_('hello from jython') + l = long(len(s)) + assert s.count('o', 0L, l) == 3 + assert s.endswith('n', 0L, l) == True + assert s.expandtabs(1L) == s + assert s.find('h', 0L, l) == 0 + assert s.index('h', 0L, l) == 0 + assert s.rfind('h', 0L, l) == 14 + assert s.rindex('h', 0L, l) == 14 + assert s.split(' ', 1L) == ['hello', 'from jython'] + assert s.startswith('jython', 11L) + + def _test_file(self, test_file): + test_file.write('jython') + test_file.seek(0L) + assert test_file.read(1L) == 'j' + assert test_file.readline(2L) == 'yt' + assert test_file.readlines(3L) == ['hon'] + +def test_main(): + test_support.run_unittest(LongIntArgsTestCase) + +if __name__ == '__main__': + test_main() Modified: branches/Release_2_2maint/jython/src/org/python/core/PyList.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyList.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PyList.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -283,6 +283,82 @@ } dict.__setitem__("__setslice__",new PyMethodDescr("__setslice__",PyList.class,3,4,new exposed___setslice__(null,null))); + class exposed___add__ extends PyBuiltinMethodNarrow { + + exposed___add__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___add__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyList)self).list___add__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__add__",new PyMethodDescr("__add__",PyList.class,1,1,new exposed___add__(null,null))); + class exposed___radd__ extends PyBuiltinMethodNarrow { + + exposed___radd__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___radd__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyList)self).list___radd__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__radd__",new PyMethodDescr("__radd__",PyList.class,1,1,new exposed___radd__(null,null))); + class exposed___mul__ extends PyBuiltinMethodNarrow { + + exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___mul__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyList)self).list___mul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyList.class,1,1,new exposed___mul__(null,null))); + class exposed___rmul__ extends PyBuiltinMethodNarrow { + + exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___rmul__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyList)self).list___rmul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyList.class,1,1,new exposed___rmul__(null,null))); class exposed_append extends PyBuiltinMethodNarrow { exposed_append(PyObject self,PyBuiltinFunction.Info info) { @@ -515,38 +591,6 @@ } dict.__setitem__("__len__",new PyMethodDescr("__len__",PyList.class,0,0,new exposed___len__(null,null))); - class exposed___add__ extends PyBuiltinMethodNarrow { - - exposed___add__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___add__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyList)self).list___add__(arg0); - } - - } - dict.__setitem__("__add__",new PyMethodDescr("__add__",PyList.class,1,1,new exposed___add__(null,null))); - class exposed___radd__ extends PyBuiltinMethodNarrow { - - exposed___radd__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___radd__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyList)self).list___radd__(arg0); - } - - } - dict.__setitem__("__radd__",new PyMethodDescr("__radd__",PyList.class,1,1,new exposed___radd__(null,null))); class exposed___iadd__ extends PyBuiltinMethodNarrow { exposed___iadd__(PyObject self,PyBuiltinFunction.Info info) { @@ -595,38 +639,6 @@ } dict.__setitem__("__reduce__",new PyMethodDescr("__reduce__",PyList.class,0,0,new exposed___reduce__(null,null))); - class exposed___mul__ extends PyBuiltinMethodNarrow { - - exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___mul__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyList)self).list___mul__(arg0); - } - - } - dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyList.class,1,1,new exposed___mul__(null,null))); - class exposed___rmul__ extends PyBuiltinMethodNarrow { - - exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___rmul__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyList)self).list___rmul__(arg0); - } - - } - dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyList.class,1,1,new exposed___rmul__(null,null))); class exposed___hash__ extends PyBuiltinMethodNarrow { exposed___hash__(PyObject self,PyBuiltinFunction.Info info) { @@ -932,12 +944,23 @@ } public PyObject __imul__(PyObject o) { - return list___imul__(o); + PyObject result = list___imul__(o); + if (result == null) { + // We can't perform an in-place multiplication on o's + // type, so let o try to rmul this list. A new list will + // be created instead of modifying this one, but that's + // preferable to just blowing up on this operation. + result = o.__rmul__(this); + if (result == null) { + throw Py.TypeError(_unsupportedop("*", o)); + } + } + return result; } final PyObject list___imul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int l = size(); int count = ((PyInteger)o.__int__()).getValue(); @@ -955,14 +978,14 @@ final PyObject list___mul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } final PyObject list___rmul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } @@ -1020,15 +1043,8 @@ if (op.equals("+")) { return "can only concatenate list (not \"{2}\") to list"; } - return null; + return super.unsupportedopMessage(op, o2); } - - protected String runsupportedopMessage(String op, PyObject o2) { - if (op.equals("+")) { - return "can only concatenate list (not \"{1}\") to list"; - } - return null; - } public String toString() { return list_toString(); Modified: branches/Release_2_2maint/jython/src/org/python/core/PyLong.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyLong.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PyLong.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -947,13 +947,17 @@ if (v >= min && v <= max) return v; } - throw Py.OverflowError("long int too long to convert"); + throw Py.OverflowError("long int too large to convert"); } public long asLong(int index) { return getLong(Long.MIN_VALUE, Long.MAX_VALUE); } + public int asInt(int index) { + return (int)getLong(Integer.MIN_VALUE, Integer.MAX_VALUE); + } + public Object __tojava__(Class c) { try { if (c == Byte.TYPE || c == Byte.class) { Modified: branches/Release_2_2maint/jython/src/org/python/core/PySequence.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PySequence.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PySequence.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -474,4 +474,32 @@ } return super.__tojava__(c); } + + /** + * Return sequence-specific error messages suitable for substitution. + * + * {0} is the op name. + * {1} is the left operand type. + * {2} is the right operand type. + */ + protected String unsupportedopMessage(String op, PyObject o2) { + if (op.equals("*")) { + return "can''t multiply sequence by non-int of type ''{2}''"; + } + return null; + } + + /** + * Return sequence-specific error messages suitable for substitution. + * + * {0} is the op name. + * {1} is the left operand type. + * {2} is the right operand type. + */ + protected String runsupportedopMessage(String op, PyObject o2) { + if (op.equals("*")) { + return "can''t multiply sequence by non-int of type ''{1}''"; + } + return null; + } } Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -126,158 +126,170 @@ } dict.__setitem__("__ge__",new PyMethodDescr("__ge__",PyString.class,1,1,new exposed___ge__(null,null))); - class exposed___getitem__ extends PyBuiltinMethodNarrow { + class exposed___add__ extends PyBuiltinMethodNarrow { - exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { + exposed___add__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___getitem__(self,info); + return new exposed___add__(self,info); } public PyObject __call__(PyObject arg0) { - PyObject ret=((PyString)self).seq___finditem__(arg0); - if (ret==null) { - throw Py.IndexError("index out of range: "+arg0); - } + PyObject ret=((PyString)self).str___add__(arg0); + if (ret==null) + return Py.NotImplemented; return ret; } } - dict.__setitem__("__getitem__",new PyMethodDescr("__getitem__",PyString.class,1,1,new exposed___getitem__(null,null))); - class exposed___getslice__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__add__",new PyMethodDescr("__add__",PyString.class,1,1,new exposed___add__(null,null))); + class exposed___mod__ extends PyBuiltinMethodNarrow { - exposed___getslice__(PyObject self,PyBuiltinFunction.Info info) { + exposed___mod__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___getslice__(self,info); + return new exposed___mod__(self,info); } - public PyObject __call__(PyObject arg0,PyObject arg1,PyObject arg2) { - return((PyString)self).seq___getslice__(arg0,arg1,arg2); + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyString)self).str___mod__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; } - public PyObject __call__(PyObject arg0,PyObject arg1) { - return((PyString)self).seq___getslice__(arg0,arg1); - } - } - dict.__setitem__("__getslice__",new PyMethodDescr("__getslice__",PyString.class,2,3,new exposed___getslice__(null,null))); - class exposed___contains__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__mod__",new PyMethodDescr("__mod__",PyString.class,1,1,new exposed___mod__(null,null))); + class exposed___mul__ extends PyBuiltinMethodNarrow { - exposed___contains__(PyObject self,PyBuiltinFunction.Info info) { + exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___contains__(self,info); + return new exposed___mul__(self,info); } public PyObject __call__(PyObject arg0) { - return Py.newBoolean(((PyString)self).str___contains__(arg0)); + PyObject ret=((PyString)self).str___mul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; } } - dict.__setitem__("__contains__",new PyMethodDescr("__contains__",PyString.class,1,1,new exposed___contains__(null,null))); - class exposed___len__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyString.class,1,1,new exposed___mul__(null,null))); + class exposed___rmul__ extends PyBuiltinMethodNarrow { - exposed___len__(PyObject self,PyBuiltinFunction.Info info) { + exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___len__(self,info); + return new exposed___rmul__(self,info); } - public PyObject __call__() { - return Py.newInteger(((PyString)self).str___len__()); + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyString)self).str___rmul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; } } - dict.__setitem__("__len__",new PyMethodDescr("__len__",PyString.class,0,0,new exposed___len__(null,null))); - class exposed___add__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyString.class,1,1,new exposed___rmul__(null,null))); + class exposed___getitem__ extends PyBuiltinMethodNarrow { - exposed___add__(PyObject self,PyBuiltinFunction.Info info) { + exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___add__(self,info); + return new exposed___getitem__(self,info); } public PyObject __call__(PyObject arg0) { - return((PyString)self).str___add__(arg0); + PyObject ret=((PyString)self).seq___finditem__(arg0); + if (ret==null) { + throw Py.IndexError("index out of range: "+arg0); + } + return ret; } } - dict.__setitem__("__add__",new PyMethodDescr("__add__",PyString.class,1,1,new exposed___add__(null,null))); - class exposed___mod__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__getitem__",new PyMethodDescr("__getitem__",PyString.class,1,1,new exposed___getitem__(null,null))); + class exposed___getslice__ extends PyBuiltinMethodNarrow { - exposed___mod__(PyObject self,PyBuiltinFunction.Info info) { + exposed___getslice__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___mod__(self,info); + return new exposed___getslice__(self,info); } - public PyObject __call__(PyObject arg0) { - return((PyString)self).str___mod__(arg0); + public PyObject __call__(PyObject arg0,PyObject arg1,PyObject arg2) { + return((PyString)self).seq___getslice__(arg0,arg1,arg2); } + public PyObject __call__(PyObject arg0,PyObject arg1) { + return((PyString)self).seq___getslice__(arg0,arg1); + } + } - dict.__setitem__("__mod__",new PyMethodDescr("__mod__",PyString.class,1,1,new exposed___mod__(null,null))); - class exposed___mul__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__getslice__",new PyMethodDescr("__getslice__",PyString.class,2,3,new exposed___getslice__(null,null))); + class exposed___contains__ extends PyBuiltinMethodNarrow { - exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { + exposed___contains__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___mul__(self,info); + return new exposed___contains__(self,info); } public PyObject __call__(PyObject arg0) { - return((PyString)self).str___mul__(arg0); + return Py.newBoolean(((PyString)self).str___contains__(arg0)); } } - dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyString.class,1,1,new exposed___mul__(null,null))); - class exposed___reduce__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__contains__",new PyMethodDescr("__contains__",PyString.class,1,1,new exposed___contains__(null,null))); + class exposed___len__ extends PyBuiltinMethodNarrow { - exposed___reduce__(PyObject self,PyBuiltinFunction.Info info) { + exposed___len__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___reduce__(self,info); + return new exposed___len__(self,info); } public PyObject __call__() { - return((PyString)self).str___reduce__(); + return Py.newInteger(((PyString)self).str___len__()); } } - dict.__setitem__("__reduce__",new PyMethodDescr("__reduce__",PyString.class,0,0,new exposed___reduce__(null,null))); - class exposed___rmul__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__len__",new PyMethodDescr("__len__",PyString.class,0,0,new exposed___len__(null,null))); + class exposed___reduce__ extends PyBuiltinMethodNarrow { - exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { + exposed___reduce__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___rmul__(self,info); + return new exposed___reduce__(self,info); } - public PyObject __call__(PyObject arg0) { - return((PyString)self).str___rmul__(arg0); + public PyObject __call__() { + return((PyString)self).str___reduce__(); } } - dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyString.class,1,1,new exposed___rmul__(null,null))); + dict.__setitem__("__reduce__",new PyMethodDescr("__reduce__",PyString.class,0,0,new exposed___reduce__(null,null))); class exposed___str__ extends PyBuiltinMethodNarrow { exposed___str__(PyObject self,PyBuiltinFunction.Info info) { @@ -2108,14 +2120,14 @@ final PyObject str___mul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } final PyObject str___rmul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } @@ -3569,6 +3581,12 @@ return internedString(); } + protected String unsupportedopMessage(String op, PyObject o2) { + if (op.equals("+")) { + return "cannot concatenate ''{1}'' and ''{2}'' objects"; + } + return super.unsupportedopMessage(op, o2); + } } final class StringFormatter Modified: branches/Release_2_2maint/jython/src/org/python/core/PyTuple.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyTuple.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PyTuple.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -139,6 +139,63 @@ } dict.__setitem__("__ge__",new PyMethodDescr("__ge__",PyTuple.class,1,1,new exposed___ge__(null,null))); + class exposed___add__ extends PyBuiltinMethodNarrow { + + exposed___add__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___add__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyTuple)self).tuple___add__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__add__",new PyMethodDescr("__add__",PyTuple.class,1,1,new exposed___add__(null,null))); + class exposed___mul__ extends PyBuiltinMethodNarrow { + + exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___mul__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyTuple)self).tuple___mul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyTuple.class,1,1,new exposed___mul__(null,null))); + class exposed___rmul__ extends PyBuiltinMethodNarrow { + + exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___rmul__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyTuple)self).tuple___rmul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyTuple.class,1,1,new exposed___rmul__(null,null))); class exposed___getitem__ extends PyBuiltinMethodNarrow { exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { @@ -211,22 +268,6 @@ } dict.__setitem__("__len__",new PyMethodDescr("__len__",PyTuple.class,0,0,new exposed___len__(null,null))); - class exposed___add__ extends PyBuiltinMethodNarrow { - - exposed___add__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___add__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyTuple)self).tuple___add__(arg0); - } - - } - dict.__setitem__("__add__",new PyMethodDescr("__add__",PyTuple.class,1,1,new exposed___add__(null,null))); class exposed___reduce__ extends PyBuiltinMethodNarrow { exposed___reduce__(PyObject self,PyBuiltinFunction.Info info) { @@ -243,38 +284,6 @@ } dict.__setitem__("__reduce__",new PyMethodDescr("__reduce__",PyTuple.class,0,0,new exposed___reduce__(null,null))); - class exposed___mul__ extends PyBuiltinMethodNarrow { - - exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___mul__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyTuple)self).tuple___mul__(arg0); - } - - } - dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyTuple.class,1,1,new exposed___mul__(null,null))); - class exposed___rmul__ extends PyBuiltinMethodNarrow { - - exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___rmul__(self,info); - } - - public PyObject __call__(PyObject arg0) { - return((PyTuple)self).tuple___rmul__(arg0); - } - - } - dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyTuple.class,1,1,new exposed___rmul__(null,null))); class exposed___hash__ extends PyBuiltinMethodNarrow { exposed___hash__(PyObject self,PyBuiltinFunction.Info info) { @@ -458,14 +467,14 @@ final PyObject tuple___mul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } final PyObject tuple___rmul__(PyObject o) { if (!(o instanceof PyInteger || o instanceof PyLong)) - throw Py.TypeError("can't multiply sequence to non-int"); + return null; int count = ((PyInteger)o.__int__()).getValue(); return repeat(count); } @@ -616,4 +625,11 @@ } }; } + + protected String unsupportedopMessage(String op, PyObject o2) { + if (op.equals("+")) { + return "can only concatenate tuple (not \"{2}\") to tuple"; + } + return super.unsupportedopMessage(op, o2); + } } Modified: branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -53,126 +53,135 @@ } dict.__setitem__("__eq__",new PyMethodDescr("__eq__",PyUnicode.class,1,1,new exposed___eq__(null,null))); - class exposed___getitem__ extends PyBuiltinMethodNarrow { + class exposed___add__ extends PyBuiltinMethodNarrow { - exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { + exposed___add__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___getitem__(self,info); + return new exposed___add__(self,info); } public PyObject __call__(PyObject arg0) { - PyObject ret=((PyUnicode)self).seq___finditem__(arg0); - if (ret==null) { - throw Py.IndexError("index out of range: "+arg0); - } + PyObject ret=((PyUnicode)self).unicode___add__(arg0); + if (ret==null) + return Py.NotImplemented; return ret; } } - dict.__setitem__("__getitem__",new PyMethodDescr("__getitem__",PyUnicode.class,1,1,new exposed___getitem__(null,null))); - class exposed___getslice__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__add__",new PyMethodDescr("__add__",PyUnicode.class,1,1,new exposed___add__(null,null))); + class exposed___mul__ extends PyBuiltinMethodNarrow { - exposed___getslice__(PyObject self,PyBuiltinFunction.Info info) { + exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___getslice__(self,info); + return new exposed___mul__(self,info); } - public PyObject __call__(PyObject arg0,PyObject arg1,PyObject arg2) { - return((PyUnicode)self).seq___getslice__(arg0,arg1,arg2); + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyUnicode)self).unicode___mul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; } - public PyObject __call__(PyObject arg0,PyObject arg1) { - return((PyUnicode)self).seq___getslice__(arg0,arg1); - } - } - dict.__setitem__("__getslice__",new PyMethodDescr("__getslice__",PyUnicode.class,2,3,new exposed___getslice__(null,null))); - class exposed___contains__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyUnicode.class,1,1,new exposed___mul__(null,null))); + class exposed___rmul__ extends PyBuiltinMethodNarrow { - exposed___contains__(PyObject self,PyBuiltinFunction.Info info) { + exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___contains__(self,info); + return new exposed___rmul__(self,info); } public PyObject __call__(PyObject arg0) { - return Py.newBoolean(((PyUnicode)self).unicode___contains__(arg0)); + PyObject ret=((PyUnicode)self).unicode___rmul__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; } } - dict.__setitem__("__contains__",new PyMethodDescr("__contains__",PyUnicode.class,1,1,new exposed___contains__(null,null))); - class exposed___len__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyUnicode.class,1,1,new exposed___rmul__(null,null))); + class exposed___getitem__ extends PyBuiltinMethodNarrow { - exposed___len__(PyObject self,PyBuiltinFunction.Info info) { + exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___len__(self,info); + return new exposed___getitem__(self,info); } - public PyObject __call__() { - return Py.newInteger(((PyUnicode)self).unicode___len__()); + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyUnicode)self).seq___finditem__(arg0); + if (ret==null) { + throw Py.IndexError("index out of range: "+arg0); + } + return ret; } } - dict.__setitem__("__len__",new PyMethodDescr("__len__",PyUnicode.class,0,0,new exposed___len__(null,null))); - class exposed___add__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__getitem__",new PyMethodDescr("__getitem__",PyUnicode.class,1,1,new exposed___getitem__(null,null))); + class exposed___getslice__ extends PyBuiltinMethodNarrow { - exposed___add__(PyObject self,PyBuiltinFunction.Info info) { + exposed___getslice__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___add__(self,info); + return new exposed___getslice__(self,info); } - public PyObject __call__(PyObject arg0) { - return((PyUnicode)self).unicode___add__(arg0); + public PyObject __call__(PyObject arg0,PyObject arg1,PyObject arg2) { + return((PyUnicode)self).seq___getslice__(arg0,arg1,arg2); } + public PyObject __call__(PyObject arg0,PyObject arg1) { + return((PyUnicode)self).seq___getslice__(arg0,arg1); + } + } - dict.__setitem__("__add__",new PyMethodDescr("__add__",PyUnicode.class,1,1,new exposed___add__(null,null))); - class exposed___mul__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__getslice__",new PyMethodDescr("__getslice__",PyUnicode.class,2,3,new exposed___getslice__(null,null))); + class exposed___contains__ extends PyBuiltinMethodNarrow { - exposed___mul__(PyObject self,PyBuiltinFunction.Info info) { + exposed___contains__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___mul__(self,info); + return new exposed___contains__(self,info); } public PyObject __call__(PyObject arg0) { - return((PyUnicode)self).unicode___mul__(arg0); + return Py.newBoolean(((PyUnicode)self).unicode___contains__(arg0)); } } - dict.__setitem__("__mul__",new PyMethodDescr("__mul__",PyUnicode.class,1,1,new exposed___mul__(null,null))); - class exposed___rmul__ extends PyBuiltinMethodNarrow { + dict.__setitem__("__contains__",new PyMethodDescr("__contains__",PyUnicode.class,1,1,new exposed___contains__(null,null))); + class exposed___len__ extends PyBuiltinMethodNarrow { - exposed___rmul__(PyObject self,PyBuiltinFunction.Info info) { + exposed___len__(PyObject self,PyBuiltinFunction.Info info) { super(self,info); } public PyBuiltinFunction bind(PyObject self) { - return new exposed___rmul__(self,info); + return new exposed___len__(self,info); } - public PyObject __call__(PyObject arg0) { - return((PyUnicode)self).unicode___rmul__(arg0); + public PyObject __call__() { + return Py.newInteger(((PyUnicode)self).unicode___len__()); } } - dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyUnicode.class,1,1,new exposed___rmul__(null,null))); + dict.__setitem__("__len__",new PyMethodDescr("__len__",PyUnicode.class,0,0,new exposed___len__(null,null))); class exposed___str__ extends PyBuiltinMethodNarrow { exposed___str__(PyObject self,PyBuiltinFunction.Info info) { Modified: branches/Release_2_2maint/jython/src/org/python/util/ReadlineConsole.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/util/ReadlineConsole.java 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/org/python/util/ReadlineConsole.java 2007-09-20 01:34:30 UTC (rev 3486) @@ -1,8 +1,12 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.util; +import java.io.EOFException; +import java.io.IOException; + import org.gnu.readline.Readline; import org.gnu.readline.ReadlineLibrary; + import org.python.core.Py; import org.python.core.PyException; import org.python.core.PyObject; @@ -37,6 +41,14 @@ // Will use a pure java fallback. } Readline.initReadline("jython"); + + try { + // Force rebind of tab to insert a tab instead of complete + Readline.parseAndBind("tab: tab-insert"); + } + catch (UnsupportedOperationException uoe) { + // parseAndBind not supported by this readline + } } /** @@ -51,9 +63,9 @@ try { String line = Readline.readline(prompt == null ? "" : prompt.toString()); return (line == null ? "" : line); - } catch(java.io.EOFException eofe) { + } catch(EOFException eofe) { throw new PyException(Py.EOFError); - } catch(java.io.IOException e) { + } catch(IOException ioe) { throw new PyException(Py.IOError); } } Modified: branches/Release_2_2maint/jython/src/templates/list.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/list.expose 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/templates/list.expose 2007-09-20 01:34:30 UTC (rev 3486) @@ -5,6 +5,7 @@ incl: sequence #expose_meth: seq_> __iter__ # exposed methods +expose_binary: __add__ __radd__ __mul__ __rmul__ expose_meth: :- append o expose_meth: :i count o expose_meth: :- extend o @@ -15,13 +16,9 @@ expose_meth: :- reverse expose_meth: :- sort o? expose_meth: :i __len__ -expose_meth: __add__ o -expose_meth: __radd__ o expose_meth: __iadd__ o expose_meth: __imul__ o expose_meth: __reduce__ -expose_meth: __mul__ o -expose_meth: __rmul__ o expose_meth: __hash__ `ideleg`(hashCode); expose_meth: __repr__ Modified: branches/Release_2_2maint/jython/src/templates/str.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/str.expose 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/templates/str.expose 2007-09-20 01:34:30 UTC (rev 3486) @@ -5,14 +5,11 @@ expose_index_getitem: seq_> expose_meth: seq_> __getslice__ ooo? # -expose_binary: __ne__ __eq__ __lt__ __le__ __gt__ __ge__ +expose_binary: __ne__ __eq__ __lt__ __le__ __gt__ __ge__ __add__ __mod__ \ + __mul__ __rmul__ expose_meth: :b __contains__ o expose_meth: :i __len__ -expose_meth: __add__ o -expose_meth: __mod__ o -expose_meth: __mul__ o expose_meth: __reduce__ -expose_meth: __rmul__ o expose_meth: __str__ expose_meth: __unicode__ expose_meth: __hash__ Modified: branches/Release_2_2maint/jython/src/templates/tuple.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/tuple.expose 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/templates/tuple.expose 2007-09-20 01:34:30 UTC (rev 3486) @@ -7,13 +7,11 @@ expose_meth: seq_> __getslice__ ooo? #expose_meth: seq_> __iter__ # -expose_binary: __ne__ __eq__ __lt__ __le__ __gt__ __ge__ +expose_binary: __ne__ __eq__ __lt__ __le__ __gt__ __ge__ __add__ __mul__ \ + __rmul__ expose_meth: :b __contains__ o expose_meth: :i __len__ -expose_meth: __add__ o expose_meth: __reduce__ -expose_meth: __mul__ o -expose_meth: __rmul__ o expose_meth: __hash__ `ideleg`(hashCode); expose_meth: __repr__ Modified: branches/Release_2_2maint/jython/src/templates/unicode.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-20 00:37:45 UTC (rev 3485) +++ branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-20 01:34:30 UTC (rev 3486) @@ -5,12 +5,9 @@ expose_index_getitem: seq_> expose_meth: seq_> __getslice__ ooo? # -expose_binary: __ne__ __eq__ +expose_binary: __ne__ __eq__ __add__ __mul__ __rmul__ expose_meth: :b __contains__ o expose_meth: :i __len__ -expose_meth: __add__ o -expose_meth: __mul__ o -expose_meth: __rmul__ o expose_meth: __str__ expose_meth: __unicode__ expose_meth: __hash__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2007-09-21 08:26:34
|
Revision: 3491 http://jython.svn.sourceforge.net/jython/?rev=3491&view=rev Author: cgroves Date: 2007-09-21 01:26:32 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Merged revisions 3490 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3490 | cgroves | 2007-09-21 01:23:09 -0700 (Fri, 21 Sep 2007) | 1 line Calendar.HOUR is in AM/PM, Calendar.HOUR_OF_DAY is in 24 hour time. Fixes bug #1782856 ........ Modified Paths: -------------- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JavaDateFactory.java branches/Release_2_2maint/jython/src/org/python/core/PyArray.java branches/Release_2_2maint/jython/src/org/python/core/PyString.java Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490 Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JavaDateFactory.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JavaDateFactory.java 2007-09-21 08:23:09 UTC (rev 3490) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/JavaDateFactory.java 2007-09-21 08:26:32 UTC (rev 3491) @@ -55,7 +55,7 @@ Calendar c = Calendar.getInstance(); - c.set(Calendar.HOUR, hour); + c.set(Calendar.HOUR_OF_DAY, hour); c.set(Calendar.MINUTE, minute); c.set(Calendar.SECOND, second); @@ -80,7 +80,7 @@ c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month - 1); c.set(Calendar.DATE, day); - c.set(Calendar.HOUR, hour); + c.set(Calendar.HOUR_OF_DAY, hour); c.set(Calendar.MINUTE, minute); c.set(Calendar.SECOND, second); c.set(Calendar.MILLISECOND, 0); @@ -106,7 +106,7 @@ Calendar c = Calendar.getInstance(); c.setTime(new java.util.Date(ticks * 1000)); - c.set(Calendar.HOUR, 0); + c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); Modified: branches/Release_2_2maint/jython/src/org/python/core/PyArray.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyArray.java 2007-09-21 08:23:09 UTC (rev 3490) +++ branches/Release_2_2maint/jython/src/org/python/core/PyArray.java 2007-09-21 08:26:32 UTC (rev 3491) @@ -1676,7 +1676,7 @@ delegate.replaceSubArray(chars, start); } else { if(value instanceof PyString && type == Byte.TYPE) { - byte[] chars = ((PyString)value).getBytes(); + byte[] chars = ((PyString)value).toBytes(); if(chars.length == stop - start && step == 1) { System.arraycopy(chars, 0, data, start, chars.length); } else { Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-21 08:23:09 UTC (rev 3490) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-21 08:26:32 UTC (rev 3491) @@ -2018,7 +2018,7 @@ * underlying String. Each byte contains the low-order bits of its * corresponding char. */ - public byte[] getBytes() { + public byte[] toBytes() { return to_bytes(string); } @@ -2061,7 +2061,7 @@ if (c.isArray()) { if (c.getComponentType() == Byte.TYPE) - return getBytes(); + return toBytes(); if (c.getComponentType() == Character.TYPE) return string.toCharArray(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2007-09-22 06:25:22
|
Revision: 3499 http://jython.svn.sourceforge.net/jython/?rev=3499&view=rev Author: pjenvey Date: 2007-09-21 23:25:20 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Merged revisions 3492,3496,3498 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3492 | cgroves | 2007-09-21 01:38:05 -0700 (Fri, 21 Sep 2007) | 1 line Fix bug #1782493. Show the java version in --version ........ r3498 | pjenvey | 2007-09-21 22:20:26 -0700 (Fri, 21 Sep 2007) | 5 lines have str subclasses return a new string instead of themselves during str(subtype). fixes a pickling issue triggered by test_subclasses patch #1773865 thanks mehendran ........ Modified Paths: -------------- branches/Release_2_2maint/jython/src/org/python/core/PyString.java branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java branches/Release_2_2maint/jython/src/org/python/util/jython.java Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498 Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-22 05:20:26 UTC (rev 3498) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-22 06:25:20 UTC (rev 3499) @@ -1611,7 +1611,7 @@ if(S == null) { return new PyString(""); } - return S.__str__(); + return new PyString(S.__str__().toString()); } else { if (S == null) { return new PyStringDerived(subtype, ""); Modified: branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-22 05:20:26 UTC (rev 3498) +++ branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-22 06:25:20 UTC (rev 3499) @@ -311,20 +311,7 @@ if (root == null) root = preProperties.getProperty("install.root"); - String version = preProperties.getProperty("java.version"); - if (version == null) - version = "???"; - String lversion = version.toLowerCase(); - if (lversion.startsWith("java")) - version = version.substring(4, version.length()); - - if (lversion.startsWith("jdk") || lversion.startsWith("jre")) { - version = version.substring(3, version.length()); - } - if (version.equals("12")) - version = "1.2"; - if (version != null) - platform = "java"+version; + determinePlatform(preProperties); } catch (Exception exc) { return null; } @@ -345,6 +332,26 @@ return root; } + public static void determinePlatform(Properties props) { + String version = props.getProperty("java.version"); + if (version == null) { + version = "???"; + } + String lversion = version.toLowerCase(); + if (lversion.startsWith("java")) { + version = version.substring(4, version.length()); + } + if (lversion.startsWith("jdk") || lversion.startsWith("jre")) { + version = version.substring(3, version.length()); + } + if (version.equals("12")) { + version = "1.2"; + } + if (version != null) { + platform = "java" + version; + } + } + private static void initRegistry(Properties preProperties, Properties postProperties, boolean standalone, String jarFileName) { Modified: branches/Release_2_2maint/jython/src/org/python/util/jython.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/util/jython.java 2007-09-22 05:20:26 UTC (rev 3498) +++ branches/Release_2_2maint/jython/src/org/python/util/jython.java 2007-09-22 06:25:20 UTC (rev 3499) @@ -77,6 +77,7 @@ CommandLineOptions opts = new CommandLineOptions(); if (!opts.parse(args)) { if (opts.version) { + PySystemState.determinePlatform(System.getProperties()); System.err.println(InteractiveConsole.getDefaultBanner()); System.exit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2007-09-22 12:07:44
|
Revision: 3507 http://jython.svn.sourceforge.net/jython/?rev=3507&view=rev Author: cgroves Date: 2007-09-22 05:07:42 -0700 (Sat, 22 Sep 2007) Log Message: ----------- Merged revisions 3501-3506 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3501 | cgroves | 2007-09-22 03:34:58 -0700 (Sat, 22 Sep 2007) | 9 lines Respect the cachedir setting for scanning packages when adding a jar to sys.path, and if it does need to be scanned, cache the results. Use Py.findClass rather than the context classloader to lookup classes in JavaImportHelper. This makes classes in jars on sys.path and the current PySystemState classloader available without package scanning in addition to those in the context classloader. ........ r3502 | cgroves | 2007-09-22 03:37:34 -0700 (Sat, 22 Sep 2007) | 1 line Needs to be recompiled every time as a dependent class of the compilation is deleted ........ r3503 | cgroves | 2007-09-22 04:15:23 -0700 (Sat, 22 Sep 2007) | 4 lines Call __str__ on unicode objects passed to file.write so they'll be encoded for writing. ........ r3504 | cgroves | 2007-09-22 04:15:50 -0700 (Sat, 22 Sep 2007) | 1 line Improved ignorance ........ r3505 | cgroves | 2007-09-22 04:36:57 -0700 (Sat, 22 Sep 2007) | 1 line Include the row number where an exception occured if we know it. From patch #1786999 from david-perez ........ r3506 | cgroves | 2007-09-22 04:55:50 -0700 (Sat, 22 Sep 2007) | 1 line patch #1799330 from leosoto to fix bug #1799328. Has string formatting call __unicode__ on %s in unicode objects ........ Modified Paths: -------------- branches/Release_2_2maint/jython/bugtests/simplejar/javapackage/JavaClass.java branches/Release_2_2maint/jython/bugtests/support.py branches/Release_2_2maint/jython/bugtests/test207.py branches/Release_2_2maint/jython/bugtests/test236.py branches/Release_2_2maint/jython/bugtests/test385.py branches/Release_2_2maint/jython/src/com/ziclix/python/sql/PyCursor.java branches/Release_2_2maint/jython/src/com/ziclix/python/sql/zxJDBC.java branches/Release_2_2maint/jython/src/org/python/core/JavaImportHelper.java branches/Release_2_2maint/jython/src/org/python/core/PyFile.java branches/Release_2_2maint/jython/src/org/python/core/PyString.java branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java branches/Release_2_2maint/jython/src/org/python/core/SyspathArchive.java branches/Release_2_2maint/jython/src/templates/file.expose branches/Release_2_2maint/jython/src/templates/unicode.expose Added Paths: ----------- branches/Release_2_2maint/jython/bugtests/jarmaker.py branches/Release_2_2maint/jython/bugtests/simplejar/ branches/Release_2_2maint/jython/bugtests/simplejar/javapackage/ branches/Release_2_2maint/jython/bugtests/test402.py branches/Release_2_2maint/jython/bugtests/test402m.py branches/Release_2_2maint/jython/bugtests/test402n.py Removed Paths: ------------- branches/Release_2_2maint/jython/bugtests/simplejar/javapackage/ Property Changed: ---------------- branches/Release_2_2maint/ branches/Release_2_2maint/jython/bugtests/ branches/Release_2_2maint/jython/bugtests/test400/x/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506 Property changes on: branches/Release_2_2maint/jython/bugtests ___________________________________________________________________ Name: svn:ignore - *.jar *.class *.out *.tmp *.ser *.pyc *.err jpywork cachedir support_config.py *.zip *.diff .classpath .project .ipr .iws .iml test246p test257s1.py test260s1.py test302s.py test339p test385jar test385javapackage test398cache test398javapackage test398jar test313.jar test392m.py + *.jar *.class *.out *.tmp *.ser *.pyc *.err jpywork cachedir support_config.py *.zip *.diff .classpath .project .ipr .iws .iml test246p test257s1.py test260s1.py test302s.py test339p test398cache test398javapackage test398jar test313.jar test392m.py Added: branches/Release_2_2maint/jython/bugtests/jarmaker.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/jarmaker.py (rev 0) +++ branches/Release_2_2maint/jython/bugtests/jarmaker.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -0,0 +1,24 @@ +import support +import sys +import os + +from java.io import File + +package = "javapackage" +clazz = "JavaClass" +jardir = "simplejar" +jarfn = "simple.jar" +clazzfile = File(jardir + '/'+ package, "%s.class" % clazz) # java.io.File + +def mkjar(): + jarfile = File(jardir, jarfn) + # create a .jar file containing a .class file + if not jarfile.exists(): + support.compileJava("%s/%s/%s.java" % (jardir, package, clazz)) + jarPacker = support.JarPacker(jarfile, bufsize=128) + jarPacker.addFile(clazzfile, parentDirName=package) + jarPacker.close() + return jardir + '/' + jarfn, package, clazz + + + Copied: branches/Release_2_2maint/jython/bugtests/simplejar (from rev 3506, trunk/jython/bugtests/simplejar) Copied: branches/Release_2_2maint/jython/bugtests/simplejar/javapackage (from rev 3506, trunk/jython/bugtests/simplejar/javapackage) Modified: branches/Release_2_2maint/jython/bugtests/simplejar/javapackage/JavaClass.java =================================================================== Modified: branches/Release_2_2maint/jython/bugtests/support.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/support.py 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/bugtests/support.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -73,7 +73,7 @@ def compileJava(src, **kw): classfile = src.replace('.java', '.class') - if os.path.exists(classfile) and os.stat(src).st_mtime < os.stat(classfile).st_mtime: + if not 'force' in kw and os.path.exists(classfile) and os.stat(src).st_mtime < os.stat(classfile).st_mtime: return 0 classpath = cfg.classpath if "classpath" in kw: @@ -108,13 +108,16 @@ return execCmd(cmd, kw) def runJython(cls, **kw): + javaargs = '' + if 'javaargs' in kw: + javaargs = kw['javaargs'] classpath = cfg.classpath if "classpath" in kw: classpath = os.pathsep.join([cfg.classpath, kw["classpath"]]) if UNIX: - cmd = "%s/bin/java -classpath %s -Dpython.home=%s org.python.util.jython %s" % (cfg.java_home, classpath, cfg.jython_home, cls) + cmd = "%s/bin/java -classpath %s %s -Dpython.home=%s org.python.util.jython %s" % (cfg.java_home, classpath, javaargs, cfg.jython_home, cls) elif WIN: - cmd = 'cmd /C "%s/bin/java.exe -classpath %s -Dpython.home=%s org.python.util.jython %s"' % (cfg.java_home, classpath, cfg.jython_home, cls) + cmd = 'cmd /C "%s/bin/java.exe -classpath %s %s -Dpython.home=%s org.python.util.jython %s"' % (cfg.java_home, classpath, javaargs, cfg.jython_home, cls) return execCmd(cmd, kw) def compileJPythonc(*files, **kw): Modified: branches/Release_2_2maint/jython/bugtests/test207.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test207.py 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/bugtests/test207.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -1,28 +1,34 @@ """ - +Test that file writing doesn't attempt to encode things by default and reading +doesn't decode things by default. """ import support +EURO_SIGN = u"\u20ac" +try: + EURO_SIGN.encode() + import sys + raise support.TestError('Your default encoding, %s, can handle encoding the Euro sign. This test needs the default encoding to be unable to handle on its test character' % + sys.getdefaultencoding()) +except UnicodeEncodeError: + pass + f = open("test207.out", "w") -f.write(u"\u20ac") +try: + f.write(EURO_SIGN) + raise support.TestError("Shouldn't be able to write out a Euro sign without first encoding") +except UnicodeEncodeError: + pass f.close() -f = open("test207.out", "r") -if ord(f.read()) != 0x20AC: - raise support.TestError("EURO sign didn\xF8t survive a text file") +f = open("test207.out", "w") +f.write(EURO_SIGN.encode('utf-8')) f.close() - - -f = open("test207.out", "wb") -f.write(u"\u20ac") +f = open("test207.out", "r") +encoded_euro = f.read() f.close() - -f = open("test207.out", "rb") -if ord(f.read()) != 0xAC: - raise support.TestError("EURO sign should have been truncated.") +if encoded_euro != '\xe2\x82\xac' or encoded_euro.decode('utf-8') != EURO_SIGN: + raise support.TestError("Read something other than the euro sign that we wrote out") f.close() - - -#raise support.TestError("" + `x`) Modified: branches/Release_2_2maint/jython/bugtests/test236.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test236.py 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/bugtests/test236.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -1,7 +1,7 @@ import support, os -support.compileJava("classes/test236j1.java") +support.compileJava("classes/test236j1.java", force=1) os.remove("classes/test236j2.class") onimport = 1 Modified: branches/Release_2_2maint/jython/bugtests/test385.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test385.py 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/bugtests/test385.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -9,54 +9,17 @@ use a unique java package name for the sake of this test """ +import jarmaker import support import sys -import os -from java.io import File - -PACKAGE = "test385javapackage" -CLAZZ = "test385j" -JARDIR = "test385jar" -JARFILE = "test385.jar" -CLAZZ_FILE = File(PACKAGE, "%s.class" % CLAZZ) # java.io.File - -def mkdir(dir): - if not os.path.exists(dir): - os.mkdir(dir) - -def mkjavaclass(): - mkdir(PACKAGE) - f = open("%s/%s.java" % (PACKAGE, CLAZZ), "w") - f.write(""" -package %s; -public class %s { -} -""" % (PACKAGE, CLAZZ)) - f.close() - support.compileJava("%s/%s.java" % (PACKAGE, CLAZZ)) - -def mkjar(): - mkdir(JARDIR) - jarFile = File(JARDIR, JARFILE) - jarPacker = support.JarPacker(jarFile, bufsize=128) - jarPacker.addFile(CLAZZ_FILE, parentDirName=PACKAGE) - jarPacker.close() - return jarFile - - -# create a .jar file containing a .class file -mkjavaclass() -jarFile = mkjar() - -# important: delete the class file from the file system (otherwise it can be imported) -CLAZZ_FILE.delete() -if CLAZZ_FILE.exists(): - raise AssertionError, "%s is still on the file system" % CLAZZ_FILE - +jarfn, package, clazz = jarmaker.mkjar() # append this jar file to sys.path -sys.path.append(jarFile.getAbsolutePath()) +sys.path.append(jarfn) # try to import the class -importStmt = "from %s import %s" % (PACKAGE, CLAZZ) -exec(importStmt) \ No newline at end of file +importStmt = "from %s import %s" % (package, clazz) +try: + exec(importStmt) +finally: + sys.path.remove(jarfn) Property changes on: branches/Release_2_2maint/jython/bugtests/test400/x ___________________________________________________________________ Name: svn:ignore + *class Added: branches/Release_2_2maint/jython/bugtests/test402.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test402.py (rev 0) +++ branches/Release_2_2maint/jython/bugtests/test402.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -0,0 +1,24 @@ +''' + +test402m adds a jar file to sys.path and imports a package from it. The first +run ensures that, by default, package scanning is enabled for jars added to +sys.path. The second run turns off package scanning, so it checks that the +package is unimportable without the scan. Finally, we run test402n which adds +the same jar to its sys.path and imports a fully qualified class from it. We +run it with package scanning off to make sure that even without package +scanning, jars are correctly added to sys.path and fully qualified class +imports work on them. + +''' + +import support +import jarmaker + +jarmaker.mkjar() + +support.runJython('test402m.py') +ret = support.runJython('test402m.py', error='test402.err', + javaargs='-Dpython.cachedir.skip=true', expectError=1) +if ret == 0: + raise support.TestError('Successfully imported a package from a jar on sys.path without caching!') +support.runJython('test402n.py', javaargs='-Dpython.cachedir.skip=true') Added: branches/Release_2_2maint/jython/bugtests/test402m.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test402m.py (rev 0) +++ branches/Release_2_2maint/jython/bugtests/test402m.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -0,0 +1,4 @@ +import sys +sys.path.append('simplejar/simple.jar') + +import javapackage Added: branches/Release_2_2maint/jython/bugtests/test402n.py =================================================================== --- branches/Release_2_2maint/jython/bugtests/test402n.py (rev 0) +++ branches/Release_2_2maint/jython/bugtests/test402n.py 2007-09-22 12:07:42 UTC (rev 3507) @@ -0,0 +1,4 @@ +import sys +sys.path.append('simplejar/simple.jar') + +from javapackage import JavaClass Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/PyCursor.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/PyCursor.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/PyCursor.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -553,7 +553,7 @@ * @param maxRows integer value of max rows */ public void execute(final PyObject sql, PyObject params, PyObject bindings, PyObject maxRows) { - + int rowIndex = -1; this.clear(); boolean hasParams = hasParams(params); @@ -573,10 +573,12 @@ if (isSeqSeq(params)) { // [(3, 4)] or [(3, 4), (5, 6)] + rowIndex = 0; for (int i = 0, len = params.__len__(); i < len; i++) { PyObject param = params.__getitem__(i); this.execute(param, bindings); + rowIndex++; } } else { this.execute(params, bindings); @@ -590,7 +592,7 @@ } catch (PyException e) { throw e; } catch (Throwable e) { - throw zxJDBC.makeException(e); + throw zxJDBC.makeException(zxJDBC.Error, e, rowIndex); } finally { if (this.statement != null) { Modified: branches/Release_2_2maint/jython/src/com/ziclix/python/sql/zxJDBC.java =================================================================== --- branches/Release_2_2maint/jython/src/com/ziclix/python/sql/zxJDBC.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/com/ziclix/python/sql/zxJDBC.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -363,7 +363,18 @@ * @return PyException */ public static PyException makeException(PyObject type, Throwable t) { - + return makeException(type, t, -1); + } + + /** + * Return a newly instantiated PyException of the given type. + * + * @param type + * @param t + * @param rowIndex Row index where the error has happened. Useful for diagnosing. + * @return PyException + */ + public static PyException makeException(PyObject type, Throwable t, int rowIndex) { if (Options.showJavaExceptions) { java.io.CharArrayWriter buf = new java.io.CharArrayWriter(); java.io.PrintWriter writer = new java.io.PrintWriter(buf); @@ -387,6 +398,9 @@ if (sqlException.getSQLState() != null) { buffer.append(", [SQLState: " + sqlException.getSQLState() + "]"); } + if(rowIndex >= 0) { + buffer.append(", [Row number: " + rowIndex + "]"); + } sqlException = sqlException.getNextException(); if (sqlException != null) { buffer.append(System.getProperty("line.separator")); Modified: branches/Release_2_2maint/jython/src/org/python/core/JavaImportHelper.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/JavaImportHelper.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/JavaImportHelper.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -176,20 +176,12 @@ } /** - * Check a java class on VM level. - * - * @param packageName - * @param className - * - * @return <code>true</code> if the java class can be doubtlessly identified, <code>false</code> otherwise. + * @return <code>true</code> if the java class can be found by the current + * Py classloader setup */ private static boolean isJavaClass(String packageName, String className) { - if (className != null && className.length() > 0) { - className = packageName.replace('.', '/') + "/" + className + ".class"; - return Thread.currentThread().getContextClassLoader().getResource(className) != null; - } else { - return false; - } + return className != null && className.length() > 0 + && Py.findClass(packageName + "." + className) != null; } /** Modified: branches/Release_2_2maint/jython/src/org/python/core/PyFile.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyFile.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/PyFile.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -953,20 +953,8 @@ } public PyObject __call__(PyObject arg0) { - try { - ((PyFile)self).file_write(arg0.asString(0)); + ((PyFile)self).file_write(arg0); return Py.None; - } catch (PyObject.ConversionException e) { - String msg; - switch (e.index) { - case 0: - msg="expected a string"; - break; - default: - msg="xxx"; - } - throw Py.TypeError(msg); - } } } @@ -1386,6 +1374,17 @@ return file_xreadlines(); } + final void file_write(PyObject o) { + if(o instanceof PyUnicode) { + // Call __str__ on unicode objects to encode them before writing + file_write(o.__str__().string); + } else if(o instanceof PyString) { + file_write(((PyString)o).string); + } else { + throw Py.TypeError("write requires a string as its argument"); + } + } + final void file_write(String s) { if (closed) err_closed(); Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -3598,6 +3598,7 @@ int precision; int argIndex; PyObject args; + boolean unicodeCoercion; final char pop() { try { @@ -3616,8 +3617,13 @@ } public StringFormatter(String format) { + this(format, false); + } + + public StringFormatter(String format, boolean unicodeCoercion) { index = 0; this.format = format; + this.unicodeCoercion = unicodeCoercion; buffer = new StringBuffer(format.length()+100); } @@ -3921,7 +3927,10 @@ case 'r': fill = ' '; if (c == 's') - string = arg.__str__().toString(); + if (unicodeCoercion) + string = arg.__unicode__().toString(); + else + string = arg.__str__().toString(); else string = arg.__repr__().toString(); if (precision >= 0 && string.length() > precision) { Modified: branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/PySystemState.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -538,6 +538,10 @@ public static PackageManager packageManager; public static File cachedir; + + public static boolean isPackageCacheEnabled() { + return cachedir != null; + } private static void initCacheDirectory(Properties props) { if (Py.frozen) { Modified: branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -110,6 +110,25 @@ } dict.__setitem__("__rmul__",new PyMethodDescr("__rmul__",PyUnicode.class,1,1,new exposed___rmul__(null,null))); + class exposed___mod__ extends PyBuiltinMethodNarrow { + + exposed___mod__(PyObject self,PyBuiltinFunction.Info info) { + super(self,info); + } + + public PyBuiltinFunction bind(PyObject self) { + return new exposed___mod__(self,info); + } + + public PyObject __call__(PyObject arg0) { + PyObject ret=((PyUnicode)self).unicode___mod__(arg0); + if (ret==null) + return Py.NotImplemented; + return ret; + } + + } + dict.__setitem__("__mod__",new PyMethodDescr("__mod__",PyUnicode.class,1,1,new exposed___mod__(null,null))); class exposed___getitem__ extends PyBuiltinMethodNarrow { exposed___getitem__(PyObject self,PyBuiltinFunction.Info info) { @@ -1509,9 +1528,14 @@ } public PyObject __mod__(PyObject other) { - return str___mod__(other).__unicode__(); + return unicode___mod__(other); } + final PyObject unicode___mod__(PyObject other){ + StringFormatter fmt = new StringFormatter(string, true); + return fmt.format(other).__unicode__(); + } + final PyUnicode unicode___unicode__() { return str___unicode__(); } Modified: branches/Release_2_2maint/jython/src/org/python/core/SyspathArchive.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/SyspathArchive.java 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/org/python/core/SyspathArchive.java 2007-09-22 12:07:42 UTC (rev 3507) @@ -13,7 +13,9 @@ throw new IOException("path '" + archiveName + "' not an archive"); } this.zipFile = new ZipFile(new File(archiveName)); - PySystemState.packageManager.addJar(archiveName, false); + if(PySystemState.isPackageCacheEnabled()) { + PySystemState.packageManager.addJar(archiveName, true); + } } SyspathArchive(ZipFile zipFile, String archiveName) { Modified: branches/Release_2_2maint/jython/src/templates/file.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/file.expose 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/templates/file.expose 2007-09-22 12:07:42 UTC (rev 3507) @@ -24,7 +24,7 @@ expose_meth: :l tell expose_meth: :o next expose_meth: :- truncate l? -expose_meth: :- write s +expose_meth: :- write o expose_meth: :- writelines o expose_meth: :o xreadlines expose_wide_meth: __init__ -1 -1 Modified: branches/Release_2_2maint/jython/src/templates/unicode.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-22 11:55:50 UTC (rev 3506) +++ branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-22 12:07:42 UTC (rev 3507) @@ -5,7 +5,7 @@ expose_index_getitem: seq_> expose_meth: seq_> __getslice__ ooo? # -expose_binary: __ne__ __eq__ __add__ __mul__ __rmul__ +expose_binary: __ne__ __eq__ __add__ __mul__ __rmul__ __mod__ expose_meth: :b __contains__ o expose_meth: :i __len__ expose_meth: __str__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2007-09-24 06:09:39
|
Revision: 3526 http://jython.svn.sourceforge.net/jython/?rev=3526&view=rev Author: pjenvey Date: 2007-09-23 23:09:38 -0700 (Sun, 23 Sep 2007) Log Message: ----------- Merged revisions 3512-3513,3515-3517,3522,3524 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3512 | cgroves | 2007-09-22 15:34:31 -0700 (Sat, 22 Sep 2007) | 1 line Add a couple tests for iter on Java collections ........ r3524 | pjenvey | 2007-09-23 22:58:54 -0700 (Sun, 23 Sep 2007) | 4 lines fix javashell not handling unicode commands correctly, with tests fixes bug #1735774 thanks Pekka Laukkanen ........ Modified Paths: -------------- branches/Release_2_2maint/jython/Lib/javashell.py branches/Release_2_2maint/jython/Lib/test/test_javashell.py branches/Release_2_2maint/jython/Lib/test/test_jbasic.py branches/Release_2_2maint/jython/NEWS Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3519-3520 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3512-3513,3515-3517,3519-3520,3522,3524 Modified: branches/Release_2_2maint/jython/Lib/javashell.py =================================================================== --- branches/Release_2_2maint/jython/Lib/javashell.py 2007-09-24 06:06:21 UTC (rev 3525) +++ branches/Release_2_2maint/jython/Lib/javashell.py 2007-09-24 06:09:38 UTC (rev 3526) @@ -75,7 +75,7 @@ " setting %s. Failed command=%s""" raise OSError( 0, msgFmt % ( _osType, _envType, cmd )) - if isinstance(cmd, types.StringType): + if isinstance(cmd, basestring): shellCmd = self.cmd + [cmd] else: shellCmd = cmd Modified: branches/Release_2_2maint/jython/Lib/test/test_javashell.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/test_javashell.py 2007-09-24 06:06:21 UTC (rev 3525) +++ branches/Release_2_2maint/jython/Lib/test/test_javashell.py 2007-09-24 06:09:38 UTC (rev 3526) @@ -163,6 +163,17 @@ newValue, value )) + def testFormatUnicodeCommand(self): + shell = javashell._ShellEnv(cmd=['runner']) + self.assertEqual(shell._formatCmd('echo hello'), ['runner', 'echo hello']) + self.assertEqual(shell._formatCmd(u'echo world'), ['runner', u'echo world']) + + def testExecuteUnicodeCommandWithRedirection(self): + process = javashell.shellexecute(u'nonexcmd 2>&1') + stdout = process.getOutputStream().toString() + process.waitFor() + self.assertNotEqual(stdout, "", "Redirecting 2>&1 failed with unicode cmd") + def test_main(): test_support.run_unittest(JavaShellTest) Modified: branches/Release_2_2maint/jython/Lib/test/test_jbasic.py =================================================================== --- branches/Release_2_2maint/jython/Lib/test/test_jbasic.py 2007-09-24 06:06:21 UTC (rev 3525) +++ branches/Release_2_2maint/jython/Lib/test/test_jbasic.py 2007-09-24 06:09:38 UTC (rev 3526) @@ -31,10 +31,16 @@ vec.addElement(i) expected = 0 -for i in vec.elements(): - assert i == expected, 'testing enumeration on java.util.Vector' +for i in vec: + assert i == expected, 'testing __iter__ on java.util.Vector' expected = expected+1 +expected = 0 +for i in iter(vec): + assert i == expected, 'testing iter(java.util.Vector)' + expected = expected+1 + + print_test('create java objects', 2) from java.math import BigInteger Modified: branches/Release_2_2maint/jython/NEWS =================================================================== --- branches/Release_2_2maint/jython/NEWS 2007-09-24 06:06:21 UTC (rev 3525) +++ branches/Release_2_2maint/jython/NEWS 2007-09-24 06:09:38 UTC (rev 3526) @@ -1,5 +1,21 @@ Jython NEWS +Jython 2.2.1 rc1 + Bugs fixed + - Reading and writing on files would run data through the JVM's default charset + - Include the row number where an exception occured while using a zxJDBC cursor + - [ 1766527 ] in keyword doesn't work on os.environ + - [ 1767194 ] xmllib applies default namespace to attributes incorrectly + - [ 1768074 ] str.replace doesn't handle an empty string to be replaced + - [ 1775893 ] in keyword does not use dict.has_key() + - [ 1782493 ] jython --version doesn't show the java version number + - [ 1782856 ] zxJDBC.Timestamp returns hours in AM/PM not 24 hour time + - [ 1783960 ] can not exclude parts from text-mode installation + - [ 1799328 ] string formatting doesn't call __unicode__ on %s in unicode objects + - [ 1763263 ] os.utime(path, None) doesn't work (incl. a patch) + - [ 1758904 ] I added doc strings for functions in os module (javaos.py). + - [ 1735774 ] Redirecting stdout/err with os.popen fails if cmd is unicode + Jython 2.2 Identical to 2.2 rc3 Jython 2.2 rc3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2007-09-24 06:16:34
|
Revision: 3528 http://jython.svn.sourceforge.net/jython/?rev=3528&view=rev Author: pjenvey Date: 2007-09-23 23:16:33 -0700 (Sun, 23 Sep 2007) Log Message: ----------- Merged revisions 3527 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3527 | pjenvey | 2007-09-23 23:15:43 -0700 (Sun, 23 Sep 2007) | 2 lines changelog r3496, r3498 ........ Modified Paths: -------------- branches/Release_2_2maint/jython/NEWS Property Changed: ---------------- branches/Release_2_2maint/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3512-3513,3515-3517,3519-3520,3522,3524 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3512-3513,3515-3517,3519-3520,3522,3524,3527 Modified: branches/Release_2_2maint/jython/NEWS =================================================================== --- branches/Release_2_2maint/jython/NEWS 2007-09-24 06:15:43 UTC (rev 3527) +++ branches/Release_2_2maint/jython/NEWS 2007-09-24 06:16:33 UTC (rev 3528) @@ -15,6 +15,8 @@ - [ 1763263 ] os.utime(path, None) doesn't work (incl. a patch) - [ 1758904 ] I added doc strings for functions in os module (javaos.py). - [ 1735774 ] Redirecting stdout/err with os.popen fails if cmd is unicode + - [ 1773865 ] Patch for [1768990] pickle fails on subclasses + - [ 1783153 ] Patch: compatibility with Java 1.3 for Jython 2.2 Jython 2.2 Identical to 2.2 rc3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2007-09-27 06:49:14
|
Revision: 3549 http://jython.svn.sourceforge.net/jython/?rev=3549&view=rev Author: cgroves Date: 2007-09-26 23:49:09 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Merged revisions 3538,3540,3542,3544-3545,3547-3548 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk ........ r3538 | cgroves | 2007-09-24 21:25:04 -0700 (Mon, 24 Sep 2007) | 1 line Remove the __unicode__ descriptor from object since it just calls through to str which isn't very useful, confuses code that expects __unicode__ to do something, and diverges from CPython. From patch #1800381 from tristanlk to fix bug #1800378 ........ r3540 | cgroves | 2007-09-24 21:26:09 -0700 (Mon, 24 Sep 2007) | 1 line Ignore new jar and class ........ r3542 | cgroves | 2007-09-25 02:09:39 -0700 (Tue, 25 Sep 2007) | 1 line Add __unicode__ so subclasses will get their __unicode__ method invoked if it exists ........ r3547 | cgroves | 2007-09-26 23:22:01 -0700 (Wed, 26 Sep 2007) | 1 line decode str going in to unicode objects and don't put the results from unicode_join into a PyUnicode object since it already is one ........ r3548 | cgroves | 2007-09-26 23:46:54 -0700 (Wed, 26 Sep 2007) | 1 line Get the couple of changes for rc2 ........ Modified Paths: -------------- branches/Release_2_2maint/jython/NEWS branches/Release_2_2maint/jython/src/org/python/core/PyInstance.java branches/Release_2_2maint/jython/src/org/python/core/PyObject.java branches/Release_2_2maint/jython/src/org/python/core/PyString.java branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java branches/Release_2_2maint/jython/src/templates/object.expose branches/Release_2_2maint/jython/src/templates/unicode.expose Property Changed: ---------------- branches/Release_2_2maint/ branches/Release_2_2maint/jython/bugtests/simplejar/ branches/Release_2_2maint/jython/bugtests/simplejar/javapackage/ Property changes on: branches/Release_2_2maint ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3512-3513,3515-3517,3519-3520,3522,3524,3527,3543 + /trunk:1-3437,3458,3461,3466-3467,3471-3474,3479-3480,3490,3492,3496,3498,3501-3506,3512-3513,3515-3517,3519-3520,3522,3524,3527,3538,3540,3542-3545,3547-3548 Modified: branches/Release_2_2maint/jython/NEWS =================================================================== --- branches/Release_2_2maint/jython/NEWS 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/NEWS 2007-09-27 06:49:09 UTC (rev 3549) @@ -1,5 +1,10 @@ Jython NEWS +Jython 2.2.1 rc2 + Bugs fixed + - [ 1800378 ] __unicode__ ignored on subclasses of builtin types + - [ 1801802 ] JavaImportHelper not thread safe + Jython 2.2.1 rc1 Bugs fixed - Reading and writing on files would run data through the JVM's default charset Property changes on: branches/Release_2_2maint/jython/bugtests/simplejar ___________________________________________________________________ Name: svn:ignore + simple.jar Property changes on: branches/Release_2_2maint/jython/bugtests/simplejar/javapackage ___________________________________________________________________ Name: svn:ignore + JavaClass.class Modified: branches/Release_2_2maint/jython/src/org/python/core/PyInstance.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyInstance.java 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/org/python/core/PyInstance.java 2007-09-27 06:49:09 UTC (rev 3549) @@ -412,6 +412,19 @@ return (PyString)ret; } + public PyUnicode __unicode__() { + PyObject ret = invoke_ex("__unicode__"); + if(ret == null) { + return super.__unicode__(); + } else if(ret instanceof PyUnicode) { + return (PyUnicode)ret; + } else if(ret instanceof PyString) { + return new PyUnicode((PyString)ret); + } else { + throw Py.TypeError("__unicode__ must return unicode or str"); + } + } + public int hashCode() { PyObject ret; ret = invoke_ex("__hash__"); Modified: branches/Release_2_2maint/jython/src/org/python/core/PyObject.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyObject.java 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/org/python/core/PyObject.java 2007-09-27 06:49:09 UTC (rev 3549) @@ -176,22 +176,6 @@ } dict.__setitem__("__repr__",new PyMethodDescr("__repr__",PyObject.class,0,0,new exposed___repr__(null,null))); - class exposed___unicode__ extends PyBuiltinMethodNarrow { - - exposed___unicode__(PyObject self,PyBuiltinFunction.Info info) { - super(self,info); - } - - public PyBuiltinFunction bind(PyObject self) { - return new exposed___unicode__(self,info); - } - - public PyObject __call__() { - return new PyUnicode(self.__str__()); - } - - } - dict.__setitem__("__unicode__",new PyMethodDescr("__unicode__",PyObject.class,0,0,new exposed___unicode__(null,null))); class exposed___init__ extends PyBuiltinMethod { exposed___init__(PyObject self,PyBuiltinFunction.Info info) { Modified: branches/Release_2_2maint/jython/src/org/python/core/PyString.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/org/python/core/PyString.java 2007-09-27 06:49:09 UTC (rev 3549) @@ -1640,7 +1640,7 @@ } final PyUnicode str___unicode__() { - return new PyUnicode(this.toString()); + return new PyUnicode(this); } public int __len__() { Modified: branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java =================================================================== --- branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/org/python/core/PyUnicode.java 2007-09-27 06:49:09 UTC (rev 3549) @@ -878,7 +878,7 @@ } public PyObject __call__(PyObject arg0) { - return new PyUnicode(((PyUnicode)self).unicode_join(arg0)); + return((PyUnicode)self).unicode_join(arg0); } } @@ -1482,7 +1482,7 @@ } public PyUnicode(PyType subtype, PyString pystring) { - this(subtype, (String)pystring.__tojava__(String.class)); + this(subtype, pystring.decode().toString()); } Modified: branches/Release_2_2maint/jython/src/templates/object.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/object.expose 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/templates/object.expose 2007-09-27 06:49:09 UTC (rev 3549) @@ -20,8 +20,6 @@ return new PyInteger(self.object_hashCode()); expose_meth: __repr__ return new PyString(self.object_toString()); -expose_meth: __unicode__ - return new PyUnicode(self.__str__()); expose_new_mutable: expose_wide_meth: __init__ -1 -1 `vdeleg`(init); Modified: branches/Release_2_2maint/jython/src/templates/unicode.expose =================================================================== --- branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-27 06:46:54 UTC (rev 3548) +++ branches/Release_2_2maint/jython/src/templates/unicode.expose 2007-09-27 06:49:09 UTC (rev 3549) @@ -33,7 +33,7 @@ expose_meth: :b istitle expose_meth: :b isunicode expose_meth: :b isupper -expose_meth: :u join o +expose_meth: join o expose_meth: :u ljust i expose_meth: :u lower expose_meth: :u lstrip S? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |