You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Finn B. <bc...@us...> - 2001-12-27 15:14:30
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3183 Modified Files: javapath.py Log Message: Extra check to verify that the parameter is a string. Fix for bug "[ #495602 ] os.path.dirname() can result in an NPE". Index: javapath.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/javapath.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** javapath.py 2001/12/20 18:35:58 1.8 --- javapath.py 2001/12/27 15:14:27 1.9 *************** *** 21,26 **** --- 21,34 ---- import os + def _tostr(s, method): + if isinstance(s, "".__class__): + return s + import org + raise TypeError, "%s() argument must be a string object, not %s" % ( + method, org.python.core.Py.safeRepr(s)) + def dirname(path): """Return the directory component of a pathname""" + path = _tostr(path, "dirname") result = File(path).getParent() if not result: *************** *** 33,36 **** --- 41,45 ---- def basename(path): """Return the final component of a pathname""" + path = _tostr(path, "basename") return File(path).getName() *************** *** 42,45 **** --- 51,55 ---- """ + path = _tostr(path, "split") return (dirname(path), basename(path)) *************** *** 76,97 **** --- 86,113 ---- """ + path = _tostr(path, "exists") return File(path).exists() def isabs(path): """Test whether a path is absolute""" + path = _tostr(path, "isabs") return File(path).isAbsolute() def isfile(path): """Test whether a path is a regular file""" + path = _tostr(path, "isfile") return File(path).isFile() def isdir(path): """Test whether a path is a directory""" + path = _tostr(path, "isdir") return File(path).isDirectory() def join(path, *args): """Join two or more pathname components, inserting os.sep as needed""" + path = _tostr(path, "join") f = File(path) for a in args: + a = _tostr(a, "join") g = File(a) if g.isAbsolute() or len(f.getPath()) == 0: *************** *** 107,110 **** --- 123,127 ---- """ + path = _tostr(path, "normcase") return File(path).getPath() *************** *** 131,134 **** --- 148,153 ---- def samefile(path, path2): """Test whether two pathnames reference the same actual file""" + path = _tostr(path, "samefile") + path2 = _tostr(path2, "samefile") f = File(path) f2 = File(path2) *************** *** 217,224 **** --- 236,245 ---- # Return an absolute path. def abspath(path): + path = _tostr(path, "abspath") return File(path).getAbsolutePath() def getsize(path): + path = _tostr(path, "getsize") f = File(path) size = f.length() *************** *** 230,233 **** --- 251,255 ---- def getmtime(path): + path = _tostr(path, "getmtime") f = File(path) return f.lastModified() / 1000.0 *************** *** 236,239 **** --- 258,262 ---- # We can't detect access time so we return modification time. This # matches the behaviour in os.stat(). + path = _tostr(path, "getatime") f = File(path) return f.lastModified() / 1000.0 |
From: Finn B. <bc...@us...> - 2001-12-27 11:49:19
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv19642 Added Files: test353.py Log Message: Test for "[ #495604 ] imp.find_module fails when None is 2 arg" --- NEW FILE: test353.py --- """ [ #495604 ] imp.find_module fails when None is 2 arg """ import support import imp imp.find_module("re", None) |
From: Finn B. <bc...@us...> - 2001-12-27 11:44:25
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv18315 Added Files: test352.py Log Message: Test for "[ #495602 ] os.path.dirname() can result in an NPE" --- NEW FILE: test352.py --- """ [ #495602 ] os.path.dirname() can result in an NPE """ import support import os try: os.path.dirname(None) except TypeError: pass try: os.path.basename(None) except TypeError: pass try: os.path.exists(None) except TypeError: pass try: os.path.isabs(None) except TypeError: pass try: os.path.isfile(None) except TypeError: pass try: os.path.isdir(None) except TypeError: pass try: os.path.join(None) except TypeError: pass try: os.path.join(None, None) except TypeError: pass try: os.path.normcase(None) except (TypeError, AttributeError): pass try: if hasattr(os.path, "samefile"): os.path.samefile(None, None) except TypeError: pass try: os.path.abspath(None) except TypeError: pass try: os.path.getsize(None) except TypeError: pass try: os.path.getmtime(None) except TypeError: pass try: os.path.getatime(None) except TypeError: pass |
From: Finn B. <bc...@us...> - 2001-12-21 22:25:50
|
Update of /cvsroot/jython/htdocs/applets In directory usw-pr-cvs1:/tmp/cvs-serv16964/applets Modified Files: links.h Log Message: Updated with beta2. Index: links.h =================================================================== RCS file: /cvsroot/jython/htdocs/applets/links.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** links.h 2001/07/29 21:05:04 1.4 --- links.h 2001/12/21 22:25:48 1.5 *************** *** 4,8 **** <li><a href="../license.html">License</a> <li><a href="../download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=45862">Jython 2.1a3</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> --- 4,8 ---- <li><a href="../license.html">License</a> <li><a href="../download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">Jython 2.1b2</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> |
From: Finn B. <bc...@us...> - 2001-12-21 22:25:50
|
Update of /cvsroot/jython/htdocs/docs In directory usw-pr-cvs1:/tmp/cvs-serv16964/docs Modified Files: links.h Log Message: Updated with beta2. Index: links.h =================================================================== RCS file: /cvsroot/jython/htdocs/docs/links.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** links.h 2001/12/03 21:17:11 1.7 --- links.h 2001/12/21 22:25:48 1.8 *************** *** 4,8 **** <li><a href="../license.html">License</a> <li><a href="../download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=64027">Jython 2.1b1</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> --- 4,8 ---- <li><a href="../license.html">License</a> <li><a href="../download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">Jython 2.1b2</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> |
From: Finn B. <bc...@us...> - 2001-12-21 22:25:50
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv16964 Modified Files: links.h Log Message: Updated with beta2. Index: links.h =================================================================== RCS file: /cvsroot/jython/htdocs/links.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** links.h 2001/12/03 21:14:45 1.11 --- links.h 2001/12/21 22:25:47 1.12 *************** *** 4,8 **** <li><a href="license.html">License</a> <li><a href="download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=64027">Jython 2.1b1</a> <li><a href="install.html">Installing</a> <li><a href="platform.html">JVM Compatibility</a> --- 4,8 ---- <li><a href="license.html">License</a> <li><a href="download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">Jython 2.1b2</a> <li><a href="install.html">Installing</a> <li><a href="platform.html">JVM Compatibility</a> |
From: Finn B. <bc...@us...> - 2001-12-21 22:25:14
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv16819 Modified Files: index.ht Log Message: Updated with beta2. Index: index.ht =================================================================== RCS file: /cvsroot/jython/htdocs/index.ht,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** index.ht 2001/12/03 21:14:45 1.24 --- index.ht 2001/12/21 22:25:11 1.25 *************** *** 20,28 **** <dl> ! <p><dt><b>Jython 2.1 beta 1 released!</b> <dd>Download the latest release of Jython ! <a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=64027">here</a>, or <a href="NEWS.html">read a summary</a> ! of recent changes. (03-dec-2001). <p><dt><b>Jython 2.0 released!</b> --- 20,28 ---- <dl> ! <p><dt><b>Jython 2.1 beta 2 released!</b> <dd>Download the latest release of Jython ! <a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">here</a>, or <a href="NEWS.html">read a summary</a> ! of recent changes. (21-dec-2001). <p><dt><b>Jython 2.0 released!</b> *************** *** 82,86 **** </dl> ! <font size=-1> last updated 03-dec-2001 </font> --- 82,86 ---- </dl> ! <font size=-1> last updated 21-dec-2001 </font> |
From: Finn B. <bc...@us...> - 2001-12-21 22:24:03
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv16591 Modified Files: NEWS.ht Log Message: Generated from NEWS. Index: NEWS.ht =================================================================== RCS file: /cvsroot/jython/htdocs/NEWS.ht,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NEWS.ht 2001/12/03 21:13:15 1.12 --- NEWS.ht 2001/12/21 22:24:00 1.13 *************** *** 2,5 **** --- 2,27 ---- Jython NEWS + 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 *************** *** 128,132 **** 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. --- 150,154 ---- 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. *************** *** 136,140 **** 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 --- 158,162 ---- 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 *************** *** 149,158 **** 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. --- 171,180 ---- 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. *************** *** 165,174 **** 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. --- 187,196 ---- 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. *************** *** 180,184 **** 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. --- 202,206 ---- 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. *************** *** 190,194 **** 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" --- 212,216 ---- 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" *************** *** 196,204 **** - 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. --- 218,226 ---- - 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. *************** *** 209,213 **** project. ! CPython2.0 compatibility, including - List comprehension. - Extended call syntax. --- 231,235 ---- project. ! CPython2.0 compatibility, including - List comprehension. - Extended call syntax. *************** *** 222,226 **** 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 --- 244,248 ---- 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 *************** *** 232,237 **** 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. --- 254,259 ---- 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. *************** *** 297,301 **** 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, --- 319,323 ---- 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, *************** *** 322,326 **** 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 --- 344,348 ---- 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 *************** *** 363,367 **** - 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 --- 385,389 ---- - 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 *************** *** 391,395 **** - bug fixes ! --- 413,417 ---- - bug fixes ! |
From: brian z. <bz...@us...> - 2001-12-21 21:06:36
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv30132/Lib/test/zxjdbc Modified Files: test.xml Log Message: added cloudscape Index: test.xml =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/test.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test.xml 2001/12/21 03:45:27 1.3 --- test.xml 2001/12/21 21:06:34 1.4 *************** *** 185,187 **** --- 185,227 ---- </table> </vendor> + <vendor name="cloudscape" + datahandler="com.ziclix.python.sql.JDBC20DataHandler"> + <test name="driver" os="java"> + <factory class="com.ziclix.python.sql.zxJDBC" method="connect"> + <argument name="url" value="jdbc:cloudscape:ziclix;create=true"/> + <argument name="usr" value=""/> + <argument name="pwd" value=""/> + <argument name="driver" value="COM.cloudscape.core.JDBCDriver"/> + </factory> + <testcase from="zxtest" import="zxCoreTest"> + <ignore name="testRowid"/> + </testcase> + <testcase from="zxtest" import="BCPTest"/> + <testcase from="dbextstest" import="dbextsTestCase"/> + </test> + <table ref="texttable" name="c_texttable"> + create table c_texttable (a int not null, primary key(a), b long varchar not null) + </table> + <table ref="floattable" name="c_floattable"> + create table c_floattable (a int, b numeric(5,2)) + </table> + <table ref="datetable" name="c_datetable"> + create table c_datetable (a int, b date) + </table> + <table ref="timetable" name="c_timetable"> + create table c_timetable (a int, b time) + </table> + <table ref="timestamptable" name="c_timestamptable"> + create table c_timestamptable (a int, b timestamp) + </table> + <table ref="blobtable" name="b_blobtable"> + create table b_blobtable (a int, b blob) + </table> + <table ref="pktable" name="b_pktable"> + create table b_pktable (a int not null, b int, primary key(a)) + </table> + <table ref="autoincrementtable" name="aitable"> + create table aitable (a int with default autoincrement not null, b int, primary key(a)) + </table> + </vendor> </tests> |
From: Finn B. <bc...@us...> - 2001-12-21 21:03:17
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv29350 Modified Files: NEWS Log Message: Prepare for beta2. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.42 retrieving revision 2.43 diff -C2 -d -r2.42 -r2.43 *** NEWS 2001/12/21 15:26:28 2.42 --- NEWS 2001/12/21 21:03:15 2.43 *************** *** 1,5 **** Jython NEWS ! XX-dec-2001 Jython 2.1 beta 2 New features. --- 1,5 ---- Jython NEWS ! 21-dec-2001 Jython 2.1 beta 2 New features. *************** *** 8,11 **** --- 8,24 ---- 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. |
From: brian z. <bz...@us...> - 2001-12-21 21:00:59
|
Update of /cvsroot/jython/jython/com/ziclix/python/sql In directory usw-pr-cvs1:/tmp/cvs-serv28746/com/ziclix/python/sql Modified Files: PyExtendedCursor.java Log Message: auto determine metadata name case Index: PyExtendedCursor.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/PyExtendedCursor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyExtendedCursor.java 2001/12/17 03:44:42 1.6 --- PyExtendedCursor.java 2001/12/21 21:00:56 1.7 *************** *** 152,158 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); String[] y = null; --- 152,158 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String t = getMetaDataName(table); String[] y = null; *************** *** 164,172 **** for (int i = 0; i < len; i++) { ! y[i] = datahandler.getMetaDataName(type.__getitem__(i)); } } else { y = new String[1]; ! y[0] = datahandler.getMetaDataName(type); } } --- 164,172 ---- for (int i = 0; i < len; i++) { ! y[i] = getMetaDataName(type.__getitem__(i)); } } else { y = new String[1]; ! y[0] = getMetaDataName(type); } } *************** *** 191,198 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); ! String c = datahandler.getMetaDataName(column); try { --- 191,198 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String t = getMetaDataName(table); ! String c = getMetaDataName(column); try { *************** *** 214,220 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String p = datahandler.getMetaDataName(procedure); try { --- 214,220 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String p = getMetaDataName(procedure); try { *************** *** 237,244 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String p = datahandler.getMetaDataName(procedure); ! String c = datahandler.getMetaDataName(column); try { --- 237,244 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String p = getMetaDataName(procedure); ! String c = getMetaDataName(column); try { *************** *** 261,267 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); try { --- 261,267 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String t = getMetaDataName(table); try { *************** *** 291,300 **** clear(); ! String pq = datahandler.getMetaDataName(primaryQualifier); ! String po = datahandler.getMetaDataName(primaryOwner); ! String pt = datahandler.getMetaDataName(primaryTable); ! String fq = datahandler.getMetaDataName(foreignQualifier); ! String fo = datahandler.getMetaDataName(foreignOwner); ! String ft = datahandler.getMetaDataName(foreignTable); try { --- 291,300 ---- clear(); ! String pq = getMetaDataName(primaryQualifier); ! String po = getMetaDataName(primaryOwner); ! String pt = getMetaDataName(primaryTable); ! String fq = getMetaDataName(foreignQualifier); ! String fo = getMetaDataName(foreignOwner); ! String ft = getMetaDataName(foreignTable); try { *************** *** 323,329 **** skipCols.add(new Integer(12)); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); boolean u = unique.__nonzero__(); boolean a = accuracy.__nonzero__(); --- 323,329 ---- skipCols.add(new Integer(12)); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String t = getMetaDataName(table); boolean u = unique.__nonzero__(); boolean a = accuracy.__nonzero__(); *************** *** 397,403 **** clear(); ! String c = datahandler.getMetaDataName(qualifier); ! String s = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); int p = DatabaseMetaData.bestRowUnknown; // scope boolean n = true; // nullable --- 397,403 ---- clear(); ! String c = getMetaDataName(qualifier); ! String s = getMetaDataName(owner); ! String t = getMetaDataName(table); int p = DatabaseMetaData.bestRowUnknown; // scope boolean n = true; // nullable *************** *** 422,428 **** clear(); ! String q = datahandler.getMetaDataName(qualifier); ! String o = datahandler.getMetaDataName(owner); ! String t = datahandler.getMetaDataName(table); try { --- 422,428 ---- clear(); ! String q = getMetaDataName(qualifier); ! String o = getMetaDataName(owner); ! String t = getMetaDataName(table); try { *************** *** 431,434 **** --- 431,463 ---- throw zxJDBC.newError(e); } + } + + /** + * Method getMetaDataName + * + * @param PyObject name + * + * @return String + * + */ + protected String getMetaDataName(PyObject name) { + + if (name == Py.None) { + return null; + } + + String string = name.__str__().toString(); + + // see if the driver can help us + try { + if (connection.connection.getMetaData().storesLowerCaseIdentifiers()) { + return string.toLowerCase(); + } else if (connection.connection.getMetaData().storesUpperCaseIdentifiers()) { + return string.toUpperCase(); + } + } catch (SQLException e) {} + + // well we don't know yet so give it to the datahandler + return datahandler.getMetaDataName(name); } } |
From: Finn B. <bc...@us...> - 2001-12-21 20:44:16
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv24976 Modified Files: liftoff.props Log Message: Prepare for beta2. Index: liftoff.props =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.props,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** liftoff.props 2001/11/27 10:14:30 1.12 --- liftoff.props 2001/12/21 20:44:13 1.13 *************** *** 2,9 **** product.author=The Jython Team product.string=Jython ! product.version=2.1b1 java.minVersion=1.1 product.root= ! destination.package_prefix=jython-2.1b1 license.licenseText=LICENSE.txt product.readmeText=README.txt --- 2,9 ---- product.author=The Jython Team product.string=Jython ! product.version=2.1b2 java.minVersion=1.1 product.root= ! destination.package_prefix=jython-2.1b2 license.licenseText=LICENSE.txt product.readmeText=README.txt |
From: <bc...@wo...> - 2001-12-21 16:01:20
|
On Fri, 21 Dec 2001 07:26:31 -0800, you wrote: > Bug fixes. >+ - [ #495870 ] zxJDBC now only prepares statements with params. You don't have to add bugs. I semi-automaticly add all the "Fixed in 2.1b2" bugs when I create the release. regards, finn |
From: brian z. <bz...@us...> - 2001-12-21 15:26:31
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv1661 Modified Files: NEWS Log Message: added zxJDBC news Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** NEWS 2001/12/21 14:46:05 2.41 --- NEWS 2001/12/21 15:26:28 2.42 *************** *** 4,9 **** --- 4,12 ---- New features. + - support for callproc() in zxJDBC is now available for most simple + stored procedure calls. Bug fixes. + - [ #495870 ] zxJDBC now only prepares statements with params. 03-dec-2001 Jython 2.1 beta 1 *************** *** 133,137 **** 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. --- 136,140 ---- 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. *************** *** 141,145 **** 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 --- 144,148 ---- 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 *************** *** 154,163 **** 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. --- 157,166 ---- 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. *************** *** 170,179 **** 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. --- 173,182 ---- 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. *************** *** 185,189 **** 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. --- 188,192 ---- 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. *************** *** 195,199 **** 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" --- 198,202 ---- 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" *************** *** 201,209 **** - 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. --- 204,212 ---- - 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. *************** *** 214,218 **** project. ! CPython2.0 compatibility, including - List comprehension. - Extended call syntax. --- 217,221 ---- project. ! CPython2.0 compatibility, including - List comprehension. - Extended call syntax. *************** *** 227,231 **** 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 --- 230,234 ---- 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 *************** *** 237,242 **** 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. --- 240,245 ---- 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. *************** *** 302,306 **** 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, --- 305,309 ---- 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, *************** *** 327,331 **** 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 --- 330,334 ---- 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 *************** *** 368,372 **** - 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 --- 371,375 ---- - 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 *************** *** 396,400 **** - bug fixes ! --- 399,403 ---- - bug fixes ! |
From: Finn B. <bc...@us...> - 2001-12-21 14:46:08
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv24548 Modified Files: NEWS Log Message: Prepare for beta2. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** NEWS 2001/12/03 20:09:38 2.40 --- NEWS 2001/12/21 14:46:05 2.41 *************** *** 1,4 **** --- 1,10 ---- Jython NEWS + XX-dec-2001 Jython 2.1 beta 2 + + New features. + + Bug fixes. + 03-dec-2001 Jython 2.1 beta 1 |
From: Finn B. <bc...@us...> - 2001-12-21 11:25:32
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv14348 Modified Files: test342.py Log Message: Now the bug is solved, turn the warning into an error. Index: test342.py =================================================================== RCS file: /cvsroot/jython/bugtests/test342.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test342.py 2001/12/03 20:13:22 1.2 --- test342.py 2001/12/21 11:25:29 1.3 *************** *** 9,11 **** #support.compare(doimp.kind,"absolute") if doimp.kind != "absolute": ! raise support.TestWarning("Should be absolute") --- 9,11 ---- #support.compare(doimp.kind,"absolute") if doimp.kind != "absolute": ! raise support.TestError("Should be absolute") |
From: Finn B. <bc...@us...> - 2001-12-21 11:25:15
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv14145 Modified Files: test336.py Log Message: Now the bug is solved, turn the warning into an error. Index: test336.py =================================================================== RCS file: /cvsroot/jython/bugtests/test336.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test336.py 2001/12/03 20:13:22 1.2 --- test336.py 2001/12/21 11:25:12 1.3 *************** *** 9,14 **** support.compileJava("classes/test336p/data/MyData.java") ! try: ! from test336p.data import MyData ! except java.lang.NoClassDefFoundError: ! raise support.TestWarning("Should not fail") --- 9,11 ---- support.compileJava("classes/test336p/data/MyData.java") ! from test336p.data import MyData |
From: brian z. <bz...@us...> - 2001-12-21 04:10:02
|
Update of /cvsroot/jython/jython/Doc In directory usw-pr-cvs1:/tmp/cvs-serv31739/Doc Modified Files: zxjdbc.ht Log Message: update callproc documentation Index: zxjdbc.ht =================================================================== RCS file: /cvsroot/jython/jython/Doc/zxjdbc.ht,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** zxjdbc.ht 2001/11/22 05:59:27 2.2 --- zxjdbc.ht 2001/12/21 04:10:00 2.3 *************** *** 153,156 **** --- 153,168 ---- DatabaseMetaData.getDatabaseProductVersion</a></dd> + <dt><p><code class="methodname">cursor.updatecount</code></p></dt> + + <dd>The value obtained from calling <a + href="http://java.sun.com/j2se/1.3/docs/api/java/sql/Statement.html#getUpdateCount()"> + Statement.getUpdateCount</a></dd> + + <dt><p><code class="methodname">cursor.rowid</code></p></dt> + + <dd>The value obtained from calling <a + href="javadoc/com/ziclix/python/sql/DataHandler.html#getRowId(java.sql.Statement)"> + DataHandler.getRowId</a></dd> + <dt><p><code class="methodname">cursor.tables(qualifier,owner,table,type)</code></p></dt> *************** *** 207,240 **** later JDBC versions.</p> <dl> ! <dt><p><code class="methodname">public PyObject ! getPyObject(ResultSet set, int col, int type);</code></p></dt> ! <dd>This method is called upon fetching data from the database. ! Given the JDBC type, return the appropriate PyObject subclass from ! the Java object at column col in the ResultSet set.</dd> <dt><p><code class="methodname">public Object getJDBCObject(PyObject object, int type);</code></p></dt> - <dd>This method is called when a PreparedStatement is created through use of the <code>execute</code> method. When the parameters are being bound to the statement, the DataHandler gets a callback to map the type. This is only called if type bindings are present.</dd> - <dt><p><code class="methodname">public Object getJDBCObject(PyObject object);</code></p></dt> - <dd>This method is called when no type bindings are present during the execution of a PreparedStatement.</dd> ! ! <dt><p><code class="methodname">public void preExecute(Statement stmt) throws SQLException;</code></p></dt> ! ! <dd>A callback prior to each execution of the statement. If the statement is a PreparedStatement (created when parameters are sent to the <code>execute</code> method), all the parameters will have been set.</dd> ! ! <dt><p><code class="methodname">public void postExecute(Statement stmt) throws SQLException;</code></p></dt> ! <dd>A callback after successfully executing the statement. This is particularly useful for cases such as auto-incrementing columns where the statement knows the inserted value.</dd> </dl> --- 219,280 ---- later JDBC versions.</p> + <br/><i><b>life cycle</b></i> <dl> ! <dt><p><code class="methodname">public void preExecute(Statement stmt) ! throws SQLException;</code></p></dt> ! <dd>A callback prior to each execution of the statement. If the statement ! is a PreparedStatement (created when parameters are sent to the ! <code>execute</code> method), all the parameters will have been set.</dd> ! <dt><p><code class="methodname">public void postExecute(Statement stmt) ! throws SQLException;</code></p></dt> ! <dd>A callback after successfully executing the statement. This is particularly ! useful for cases such as auto-incrementing columns where the statement knows the ! inserted value.</dd> ! </dl> ! <i><b>developer support</b></i> ! <dl> ! <dt><p><code class="methodname">public String getMetaDataName(String name);</code></p></dt> ! <dd>A callback for determining the proper case of a name used in a DatabaseMetaData ! method, such as getTables(). This is particularly useful for Oracle which expects ! all names to be upper case.</dd> ! <dt><p><code class="methodname">public PyObject getRowId(Statement stmt) throws SQLException;</code></p></dt> ! <dd>A callback for returning the row id of the last insert statement.</dd> ! </dl> + <i><b>binding prepared statements</b></i> + <dl> <dt><p><code class="methodname">public Object getJDBCObject(PyObject object, int type);</code></p></dt> <dd>This method is called when a PreparedStatement is created through use of the <code>execute</code> method. When the parameters are being bound to the statement, the DataHandler gets a callback to map the type. This is only called if type bindings are present.</dd> <dt><p><code class="methodname">public Object getJDBCObject(PyObject object);</code></p></dt> <dd>This method is called when no type bindings are present during the execution of a PreparedStatement.</dd> ! </dl> ! <i><b>building results</b></i> ! <dl> ! <dt><p><code class="methodname">public PyObject ! getPyObject(ResultSet set, int col, int type);</code></p></dt> ! <dd>This method is called upon fetching data from the database. ! Given the JDBC type, return the appropriate PyObject subclass from ! the Java object at column col in the ResultSet set.</dd> ! </dl> + <i><b>callable statement support</b></i> + <dl> + <dt><p><code class="methodname">public PyObject getPyObject(CallableStatement stmt, int col, + int type) throws SQLException;</code></p></dt> + <dd>This method is called upon fetching data from the database after calling a + stored procedure or function. Given the JDBC type, return the appropriate PyObject + subclass from the Java object at column col in the CallableStatement.</dd> + <dt><p><code class="methodname">public void registerOut(CallableStatement statement, + int index, int colType, int dataType) throws SQLException;</code></p></dt> + <dd>This method is called when a stored procedure or function is executed and OUT parameters + need to be registered with the statement.</dd> </dl> *************** *** 303,316 **** </pre> ! <h3>dbexts</h3> ! <p> ! dbexts is a wrapper around DB API 2.0 compliant database modules. It currently supports zxJDBC and mxODBC but could easily be modified to support others. It allows developers to write scripts without knowledge of the implementation language of Python (either C or Java). It also greatly eases the burden of database coding as much of the functionality of the Python API is exposed through easier to use methods. ! </p> ! <h3>Configuration file</h3> ! <p> ! dbexts needs a configuration file in order to create a connection. The configuration file has the following format: ! <pre> [default] name=mysql_ziclix --- 343,356 ---- </pre> ! <h3>dbexts</h3> ! <p> ! dbexts is a wrapper around DB API 2.0 compliant database modules. It currently supports zxJDBC and mxODBC but could easily be modified to support others. It allows developers to write scripts without knowledge of the implementation language of Python (either C or Java). It also greatly eases the burden of database coding as much of the functionality of the Python API is exposed through easier to use methods. ! </p> ! <h3>Configuration file</h3> ! <p> ! dbexts needs a configuration file in order to create a connection. The configuration file has the following format: ! <pre> [default] name=mysql_ziclix *************** *** 333,362 **** </pre> ! <h3>API</h3> ! dbexts will default to looking for a file named 'dbexts.ini' in the same directory as dbexts.py but can optionally be passed a filename to the <code>cfg</code> attribute. ! </p> ! <dl> ! <dt><p><code class="methodname">__init__(self, dbname=None, cfg=None, resultformatter=format_resultset, autocommit=1)</code></p></dt> ! <dd> ! The initialization method for the dbexts class. If <code>dbname</code> is None, the default connection, as specified in the <code>cfg</code> file will be used. ! </dd> ! <dt><p><code class="methodname">isql(self, sql, params=None, bindings=None, maxrows=None)</code></p></dt> ! <dd> ! Interactively execute sql statement. If <i>self.verbose</i> is true, then the results (if any) are displayed using the result formatting method. If <code>maxrows</code> is specified, only <i>maxrows</i> are displayed. ! </dd> ! <dt><p><code class="methodname">raw(self, sql, params=None, bindings=None, delim=None, comments=comments)</code></p></dt> ! <dd> ! Executes the sql statement with params and bindings as necessary. Returns a tuple consisting of (headers, results). ! </dd> ! <dt><p><code class="methodname">schema(table, full=0, sort=1)</code></p></dt> ! <dd> ! Displays the schema (indicies, foreign keys, primary keys and columns) for the table parameter. If <code>full</code> is true, also compute the exported (or referenced) keys. If <code>sort</code> is true (the default), sort the column names. <pre> >>> d.schema("store") --- 373,414 ---- </pre> ! <h3>API</h3> ! dbexts will default to looking for a file named 'dbexts.ini' in the same ! directory as dbexts.py but can optionally be passed a filename to the ! <code>cfg</code> attribute. ! </p> ! <dl> ! <dt><p><code class="methodname">__init__(self, dbname=None, cfg=None, ! resultformatter=format_resultset, autocommit=1)</code></p></dt> ! <dd> ! The initialization method for the dbexts class. If <code>dbname</code> ! is None, the default connection, as specified in the <code>cfg</code> file ! will be used. ! </dd> ! <dt><p><code class="methodname">isql(self, sql, params=None, bindings=None, ! maxrows=None)</code></p></dt> ! <dd> ! Interactively execute sql statement. If <i>self.verbose</i> is true, then the ! results (if any) are displayed using the result formatting method. If ! <code>maxrows</code> is specified, only <i>maxrows</i> are displayed. ! </dd> ! <dt><p><code class="methodname">raw(self, sql, params=None, bindings=None, ! delim=None, comments=comments)</code></p></dt> ! <dd> ! Executes the sql statement with params and bindings as necessary. Returns a ! tuple consisting of (headers, results). ! </dd> ! <dt><p><code class="methodname">schema(table, full=0, sort=1)</code></p></dt> ! <dd> ! Displays the schema (indicies, foreign keys, primary keys and columns) for the ! table parameter. If <code>full</code> is true, also compute the exported (or ! referenced) keys. If <code>sort</code> is true (the default), sort the column names. <pre> >>> d.schema("store") |
From: brian z. <bz...@us...> - 2001-12-21 03:45:30
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv27673 Modified Files: sptest.py test.xml zxtest.py Log Message: stored procedures/functions now return results Index: sptest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/sptest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sptest.py 2001/12/17 03:45:38 1.1 --- sptest.py 2001/12/21 03:45:27 1.2 *************** *** 29,33 **** c.execute("create table plsqltest (x char(20))") c.execute("create or replace procedure procnone is begin insert into plsqltest values ('testing'); end;") ! c.execute("create or replace procedure procin (y char) is begin insert into plsqltest values (y); end;") c.execute("create or replace procedure procout (y out char) is begin y := 'tested'; end;") c.execute("create or replace procedure procinout (y out varchar, z in varchar) is begin insert into plsqltest values (z); y := 'tested'; end;") --- 29,33 ---- c.execute("create table plsqltest (x char(20))") c.execute("create or replace procedure procnone is begin insert into plsqltest values ('testing'); end;") ! c.execute("create or replace procedure procin (y in char) is begin insert into plsqltest values (y); end;") c.execute("create or replace procedure procout (y out char) is begin y := 'tested'; end;") c.execute("create or replace procedure procinout (y out varchar, z in varchar) is begin insert into plsqltest values (z); y := 'tested'; end;") *************** *** 64,134 **** finally: c.close() - - def testProcinout(self): - c = self.cursor() - try: - p = Procedure(c, "procinout") - stmt = p.prepareCall() - params = ["testing"] - params = p.normalizeParams(params) - - self.assertEquals(2, len(params)) - assert params[0] == p.PLACEHOLDER - assert params[1] == "testing" - finally: - if stmt: - stmt.close() - c.close() ! def testFuncout(self): c = self.cursor() try: ! p = Procedure(c, "funcout") ! stmt = p.prepareCall() ! stmt.execute() ! self.assertEquals("returned", stmt.getString(1).strip()) ! self.assertEquals("tested", stmt.getString(2).strip()) finally: - if stmt: - stmt.close() c.close() ! def testProcinoutCall(self): c = self.cursor() try: c.callproc("procinout", ("testing",)) ! assert c.fetchall() == None, "expected None" finally: c.close() ! def testFuncnoneCall(self): c = self.cursor() try: c.callproc("funcnone") ! assert c.fetchall() == None, "expected None" finally: c.close() ! def testFuncinCall(self): c = self.cursor() try: c.callproc("funcin", ("testing",)) ! assert c.fetchall() == None, "expected None" finally: c.close() ! def testFuncoutCall(self): c = self.cursor() try: c.callproc("funcout") ! assert c.fetchall() == None, "expected None" finally: c.close() ! def testRaisesalaryCall(self): c = self.cursor() try: c.callproc("raisesal", ("jython developer", 18000)) ! assert c.fetchall() == None, "expected None" finally: c.close() --- 64,131 ---- finally: c.close() ! def testProcin(self): c = self.cursor() try: ! c.callproc("procin", ("testProcin",)) ! self.assertEquals(None, c.fetchall()) ! c.execute("select * from plsqltest") ! self.assertEquals(1, len(c.fetchall())) finally: c.close() ! def testProcinout(self): c = self.cursor() try: c.callproc("procinout", ("testing",)) ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals("tested", data[0]) finally: c.close() ! def testFuncnone(self): c = self.cursor() try: c.callproc("funcnone") ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals(1, len(data)) ! self.assertEquals("tested", data[0]) finally: c.close() ! def testFuncin(self): c = self.cursor() try: c.callproc("funcin", ("testing",)) ! self.assertEquals(1, c.rowcount) ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals(1, len(data)) ! self.assertEquals("testingtesting", data[0]) finally: c.close() ! def testFuncout(self): c = self.cursor() try: c.callproc("funcout") ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals(2, len(data)) ! self.assertEquals("returned", data[0]) ! self.assertEquals("tested", data[1].strip()) finally: c.close() ! def testRaisesalary(self): c = self.cursor() try: c.callproc("raisesal", ("jython developer", 18000)) ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals(1, len(data)) ! self.assertEquals(18000 + 100000, data[0]) finally: c.close() Index: test.xml =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/test.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test.xml 2001/12/17 03:45:38 1.2 --- test.xml 2001/12/21 03:45:27 1.3 *************** *** 2,6 **** <!-- - Jython Database Specification API 2.0 --- 2,5 ---- *************** *** 8,12 **** Copyright (c) 2001 brian zimmer <bz...@zi...> - --> --- 7,10 ---- Index: zxtest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zxtest.py 2001/12/17 03:45:38 1.2 --- zxtest.py 2001/12/21 03:45:27 1.3 *************** *** 301,305 **** assert self.has_table("floattable"), "missing attribute floattable" from java.math import BigDecimal ! values = map(lambda x, b=BigDecimal: b(x), [4.22, 123.44, 292.09, 33.2, 102.00, 445]) self._test_precision(self.table("floattable"), lambda x, y, b=BigDecimal: b(x).subtract(y).doubleValue(), values, "doubleValue") --- 301,305 ---- assert self.has_table("floattable"), "missing attribute floattable" from java.math import BigDecimal ! values = [BigDecimal(x).setScale(2, BigDecimal.ROUND_UP) for x in [4.22, 123.44, 292.09, 33.2, 102.00, 445]] self._test_precision(self.table("floattable"), lambda x, y, b=BigDecimal: b(x).subtract(y).doubleValue(), values, "doubleValue") *************** *** 308,312 **** assert self.has_table("floattable"), "missing attribute floattable" from java.math import BigDecimal ! values = map(lambda x, b=BigDecimal: b(x), [4.22, 123.44, 33.2, 102.00, 445, 292.09]) self._test_precision(self.table("floattable"), lambda x, y: x - y.doubleValue(), values, "doubleValue") --- 308,312 ---- assert self.has_table("floattable"), "missing attribute floattable" from java.math import BigDecimal ! values = [BigDecimal(x).setScale(2, BigDecimal.ROUND_UP) for x in [4.22, 123.44, 292.09, 33.2, 102.00, 445]] self._test_precision(self.table("floattable"), lambda x, y: x - y.doubleValue(), values, "doubleValue") |
From: brian z. <bz...@us...> - 2001-12-21 03:44:58
|
Update of /cvsroot/jython/jython/com/ziclix/python/sql In directory usw-pr-cvs1:/tmp/cvs-serv27534/ziclix/python/sql Modified Files: DataHandler.java Fetch.java Procedure.java Log Message: stored procedures/functions now return results Index: DataHandler.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/DataHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DataHandler.java 2001/12/07 02:56:39 1.3 --- DataHandler.java 2001/12/21 03:44:55 1.4 *************** *** 282,285 **** --- 282,387 ---- /** + * Given a CallableStatement, column and type, return the appropriate + * Jython object. + * + * @param stmt the CallableStatement + * @param col the column number (adjusted properly for JDBC) + * @param type the column type + * @throws SQLException if the type is unmappable + */ + public PyObject getPyObject(CallableStatement stmt, int col, int type) throws SQLException { + + PyObject obj = Py.None; + + switch (type) { + + case Types.CHAR : + case Types.VARCHAR : + case Types.LONGVARCHAR : + String string = stmt.getString(col); + + obj = (string == null) ? Py.None : Py.newString(string); + break; + + case Types.NUMERIC : + case Types.DECIMAL : + BigDecimal bd = stmt.getBigDecimal(col, 10); + + obj = (bd == null) ? Py.None : Py.newFloat(bd.doubleValue()); + break; + + case Types.BIT : + obj = stmt.getBoolean(col) ? Py.One : Py.Zero; + break; + + case Types.INTEGER : + case Types.TINYINT : + case Types.SMALLINT : + obj = Py.newInteger(stmt.getInt(col)); + break; + + case Types.BIGINT : + obj = new PyLong(stmt.getLong(col)); + break; + + case Types.FLOAT : + case Types.REAL : + case Types.DOUBLE : + obj = Py.newFloat(stmt.getFloat(col)); + break; + + case Types.TIME : + obj = Py.java2py(stmt.getTime(col)); + break; + + case Types.TIMESTAMP : + obj = Py.java2py(stmt.getTimestamp(col)); + break; + + case Types.DATE : + obj = Py.java2py(stmt.getDate(col)); + break; + + case Types.NULL : + obj = Py.None; + break; + + case Types.OTHER : + obj = Py.java2py(stmt.getObject(col)); + break; + + case Types.BINARY : + case Types.VARBINARY : + case Types.LONGVARBINARY : + obj = Py.java2py(stmt.getBytes(col)); + break; + + default : + Integer[] vals = { new Integer(col), new Integer(type) }; + String msg = zxJDBC.getString("errorGettingIndex", vals); + + throw new SQLException(msg); + } + + return (stmt.wasNull() || (obj == null)) ? Py.None : obj; + } + + /** + * Called when a stored procedure or function is executed and OUT parameters + * need to be registered with the statement. + * + * @param CallableStatement statement + * @param int index the JDBC offset column number + * @param int colType the column as from DatabaseMetaData (eg, procedureColumnOut) + * @param int dataType the JDBC datatype from Types + * + * @throws SQLException + * + */ + public void registerOut(CallableStatement statement, int index, int colType, int dataType) throws SQLException { + statement.registerOutParameter(index, dataType); + } + + /** * Handles checking if the object is null or None and setting it on the statement. * Index: Fetch.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/Fetch.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fetch.java 2001/12/17 03:44:42 1.2 --- Fetch.java 2001/12/21 03:44:55 1.3 *************** *** 15,33 **** /** ! * <p>The responsibility of a Fetch instance is to manage the iteration of a ResultSet. Two different ! * alogorithms are available: static or dynamic.</p> * ! * <p><b>Static</b> The static variety iterates the entire set immediately, creating the necessary Jython ! * objects and storing them. It is able to immediately close the ResultSet so a call to close() is ! * essentially a no-op from a database resource perspective (it does clear the results list however). ! * This approach also allows for the correct rowcount to be determined since the entire result set ! * has been iterated.</p> * ! * <p><b>Dynamic</b> The dynamic variety iterates the result set only as requested. This holds a bit truer to ! * the intent of the API as the fetch*() methods actually fetch when instructed. This is especially ! * useful for managing exeedingly large results, but is unable to determine the rowcount without having ! * worked through the entire result set. The other disadvantage is the ResultSet remains open throughout ! * the entire iteration. So the tradeoff is in open database resources versus JVM resources since the ! * application can keep constant space if it doesn't require the entire result set be presented as one.</p> * * @author brian zimmer --- 15,36 ---- /** ! * <p>The responsibility of a Fetch instance is to manage the iteration of a ! * ResultSet. Two different alogorithms are available: static or dynamic.</p> * ! * <p><b>Static</b> The static variety iterates the entire set immediately, ! * creating the necessary Jython objects and storing them. It is able to ! * immediately close the ResultSet so a call to close() is essentially a no-op ! * from a database resource perspective (it does clear the results list however). ! * This approach also allows for the correct rowcount to be determined since ! * the entire result set has been iterated.</p> * ! * <p><b>Dynamic</b> The dynamic variety iterates the result set only as requested. ! * This holds a bit truer to the intent of the API as the fetch*() methods actually ! * fetch when instructed. This is especially useful for managing exeedingly large ! * results, but is unable to determine the rowcount without having worked through ! * the entire result set. The other disadvantage is the ResultSet remains open ! * throughout the entire iteration. So the tradeoff is in open database resources ! * versus JVM resources since the application can keep constant space if it doesn't ! * require the entire result set be presented as one.</p> * * @author brian zimmer *************** *** 45,48 **** --- 48,57 ---- protected PyObject description; + /** True if a CallableStatement was added, false otherwise. */ + protected boolean callable; + + /** Field callableResults */ + protected PyObject callableResults; + /** * Constructor Fetch *************** *** 56,59 **** --- 65,70 ---- this.description = Py.None; this.rowcount = -1; + this.callable = false; + this.callableResults = Py.None; } *************** *** 110,113 **** --- 121,163 ---- */ public void add(CallableStatement callableStatement, Procedure procedure) { + + // set this regardless of whether the statement has results + this.callable = true; + + try { + createDescription(procedure); + + if (description.__len__() == 0) { + return; + } + + PyObject[] row = new PyObject[description.__len__()]; + + for (int i = 0, j = 0, len = procedure.columns.__len__(); i < len; i++) { + PyObject column = procedure.columns.__getitem__(i); + int colType = column.__getitem__(Procedure.COLUMN_TYPE).__int__().getValue(); + int dataType = column.__getitem__(Procedure.DATA_TYPE).__int__().getValue(); + + switch (colType) { + + case DatabaseMetaData.procedureColumnOut : + case DatabaseMetaData.procedureColumnInOut : + case DatabaseMetaData.procedureColumnReturn : + row[j++] = cursor.getDataHandler().getPyObject(callableStatement, i + 1, dataType); + break; + } + } + + this.callableResults = new PyList(); + + ((PyList)this.callableResults).append(new PyTuple(row)); + + this.rowcount = this.callableResults.__len__(); + } catch (PyException e) { + throw e; + } catch (Exception e) { + throw zxJDBC.newError(e); + } + return; } *************** *** 144,148 **** */ public final PyObject fetchall() { ! return doFetchall(); } --- 194,207 ---- */ public final PyObject fetchall() { ! ! if (callable) { ! PyObject tmp = this.callableResults; ! ! this.callableResults = Py.None; ! ! return tmp; ! } else { ! return doFetchall(); ! } } *************** *** 177,181 **** */ public final PyObject fetchmany(int size) { ! return doFetchmany(size); } --- 236,249 ---- */ public final PyObject fetchmany(int size) { ! ! if (callable) { ! PyObject tmp = this.callableResults; ! ! this.callableResults = Py.None; ! ! return tmp; ! } else { ! return doFetchmany(size); ! } } *************** *** 196,200 **** */ public final PyObject nextset() { ! return doNextset(); } --- 264,270 ---- */ public final PyObject nextset() { ! ! // no support for result sets within callable statements ! return callable ? Py.None : doNextset(); } *************** *** 210,216 **** * Cleanup any resources. */ ! abstract public void close() throws SQLException; /** * Builds a tuple containing the meta-information about each column. * --- 280,299 ---- * Cleanup any resources. */ ! public final void close() throws SQLException { + doClose(); + + this.callableResults = Py.None; + } + /** + * Method doClose + * + * @throws SQLException + * + */ + abstract public void doClose() throws SQLException; + + /** * Builds a tuple containing the meta-information about each column. * *************** *** 226,232 **** PyObject[] a = new PyObject[7]; ! a[0] = new PyString(meta.getColumnName(i)); ! a[1] = new PyInteger(meta.getColumnType(i)); ! a[2] = new PyInteger(meta.getColumnDisplaySize(i)); a[3] = Py.None; --- 309,315 ---- PyObject[] a = new PyObject[7]; ! a[0] = Py.newString(meta.getColumnName(i)); ! a[1] = Py.newInteger(meta.getColumnType(i)); ! a[2] = Py.newInteger(meta.getColumnDisplaySize(i)); a[3] = Py.None; *************** *** 240,245 **** case Types.INTEGER : case Types.SMALLINT : ! a[4] = new PyInteger(meta.getPrecision(i)); ! a[5] = new PyInteger(meta.getScale(i)); break; --- 323,328 ---- case Types.INTEGER : case Types.SMALLINT : ! a[4] = Py.newInteger(meta.getPrecision(i)); ! a[5] = Py.newInteger(meta.getScale(i)); break; *************** *** 250,254 **** } ! a[6] = new PyInteger(meta.isNullable(i)); ((PyList)this.description).append(new PyTuple(a)); --- 333,337 ---- } ! a[6] = Py.newInteger(meta.isNullable(i)); ((PyList)this.description).append(new PyTuple(a)); *************** *** 257,260 **** --- 340,399 ---- /** + * Builds a tuple containing the meta-information about each column. + * + * (name, type_code, display_size, internal_size, precision, scale, null_ok) + * + * precision and scale are only available for numeric types + */ + protected void createDescription(Procedure procedure) throws SQLException { + + this.description = new PyList(); + + for (int i = 0, len = procedure.columns.__len__(); i < len; i++) { + PyObject column = procedure.columns.__getitem__(i); + int colType = column.__getitem__(Procedure.COLUMN_TYPE).__int__().getValue(); + + switch (colType) { + + case DatabaseMetaData.procedureColumnOut : + case DatabaseMetaData.procedureColumnInOut : + case DatabaseMetaData.procedureColumnReturn : + PyObject[] a = new PyObject[7]; + + a[0] = column.__getitem__(Procedure.NAME); + a[1] = column.__getitem__(Procedure.DATA_TYPE); + a[2] = Py.newInteger(-1); + a[3] = column.__getitem__(Procedure.LENGTH); + + switch (a[1].__int__().getValue()) { + + case Types.BIGINT : + case Types.BIT : + case Types.DECIMAL : + case Types.DOUBLE : + case Types.FLOAT : + case Types.INTEGER : + case Types.SMALLINT : + a[4] = column.__getitem__(Procedure.PRECISION); + a[5] = column.__getitem__(Procedure.SCALE); + break; + + default : + a[4] = Py.None; + a[5] = Py.None; + break; + } + + int nullable = column.__getitem__(Procedure.NULLABLE).__int__().getValue(); + + a[6] = (nullable == DatabaseMetaData.procedureNullable) ? Py.One : Py.Zero; + + ((PyList)this.description).append(new PyTuple(a)); + break; + } + } + } + + /** * Creates the results of a query. Iterates through the list and builds the tuple. * *************** *** 447,451 **** counter += size; ! res = current.__getslice__(new PyInteger(start), new PyInteger(counter + 1), new PyInteger(1)); } --- 586,590 ---- counter += size; ! res = current.__getslice__(Py.newInteger(start), Py.newInteger(counter + 1), Py.newInteger(1)); } *************** *** 476,480 **** * Remove the results. */ ! public void close() throws SQLException { this.counter = -1; --- 615,619 ---- * Remove the results. */ ! public void doClose() throws SQLException { this.counter = -1; *************** *** 539,542 **** --- 678,683 ---- this.skipCols = skipCols; } + } catch (PyException e) { + throw e; } catch (Exception e) { throw zxJDBC.newError(e); *************** *** 583,586 **** --- 724,729 ---- this.rowcount = (this.rowcount == -1) ? 1 : this.rowcount + 1; } + } catch (PyException e) { + throw e; } catch (Exception e) { throw zxJDBC.newError(e); *************** *** 600,604 **** * Close the underlying ResultSet. */ ! public void close() throws SQLException { if (this.resultSet == null) { --- 743,747 ---- * Close the underlying ResultSet. */ ! public void doClose() throws SQLException { if (this.resultSet == null) { Index: Procedure.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/Procedure.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Procedure.java 2001/12/17 03:44:42 1.1 --- Procedure.java 2001/12/21 03:44:55 1.2 *************** *** 25,28 **** --- 25,31 ---- public class Procedure extends Object { + /** Field NAME */ + protected static final int NAME = 3; + /** Field COLUMN_TYPE */ protected static final int COLUMN_TYPE = 4; *************** *** 31,34 **** --- 34,49 ---- protected static final int DATA_TYPE = 5; + /** Field PRECISION */ + protected static final int PRECISION = 7; + + /** Field LENGTH */ + protected static final int LENGTH = 8; + + /** Field SCALE */ + protected static final int SCALE = 9; + + /** Field NULLABLE */ + protected static final int NULLABLE = 11; + /** Field PLACEHOLDER */ public static final PyObject PLACEHOLDER = new PyObject(); *************** *** 106,117 **** public PyObject normalizeParams(PyObject params) { - if (columns == Py.None) { - throw zxJDBC.makeException(zxJDBC.ProgrammingError, "too many params for input"); - } - if (params == Py.None) { return Py.None; } int j = 0, plen = params.__len__(); PyList population = new PyList(); --- 121,132 ---- public PyObject normalizeParams(PyObject params) { if (params == Py.None) { return Py.None; } + if (columns == Py.None) { + throw zxJDBC.makeException(zxJDBC.ProgrammingError, "too many params for input"); + } + int j = 0, plen = params.__len__(); PyList population = new PyList(); *************** *** 226,230 **** * */ ! private final void registerOutParameters(CallableStatement statement) throws SQLException { if (columns == Py.None) { --- 241,245 ---- * */ ! protected void registerOutParameters(CallableStatement statement) throws SQLException { if (columns == Py.None) { *************** *** 239,265 **** switch (colType) { - case DatabaseMetaData.procedureColumnIn : case DatabaseMetaData.procedureColumnInOut : case DatabaseMetaData.procedureColumnOut : case DatabaseMetaData.procedureColumnReturn : ! doRegister(statement, i + 1, colType, dataType); break; } } - } - - /** - * Method doRegister - * - * @param CallableStatement statement - * @param int index - * @param int colType - * @param int dataType - * - * @throws SQLException - * - */ - protected void doRegister(CallableStatement statement, int index, int colType, int dataType) throws SQLException { - statement.registerOutParameter(index, dataType); } --- 254,264 ---- switch (colType) { case DatabaseMetaData.procedureColumnInOut : case DatabaseMetaData.procedureColumnOut : case DatabaseMetaData.procedureColumnReturn : ! cursor.datahandler.registerOut(statement, i + 1, colType, dataType); break; } } } |
From: Samuele P. <ped...@us...> - 2001-12-21 00:20:20
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv19353 Modified Files: imp.java Log Message: Integrating[ #478763 ] import case sensitivity. Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.58 retrieving revision 2.59 diff -C2 -d -r2.58 -r2.59 *** imp.java 2001/12/20 16:44:06 2.58 --- imp.java 2001/12/21 00:20:17 2.59 *************** *** 448,452 **** } ! private static boolean caseok(File file, String filename, int namelen) { if (Options.caseok) return true; --- 448,452 ---- } ! static boolean caseok(File file, String filename, int namelen) { if (Options.caseok) return true; |
From: Samuele P. <ped...@us...> - 2001-12-21 00:18:15
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv18820 Modified Files: PathPackageManager.java PyJavaPackage.java Log Message: Integrating [ #478763 ] import case sensitivity Index: PathPackageManager.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PathPackageManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PathPackageManager.java 2001/10/28 17:13:42 1.5 --- PathPackageManager.java 2001/12/21 00:18:12 1.6 *************** *** 31,35 **** if (dir.length() == 0) dir = null; ! if (new File(dir,child).isDirectory()) return true; } return false; --- 31,38 ---- if (dir.length() == 0) dir = null; ! File f = new File(dir,child); ! if (f.isDirectory() && imp.caseok(f, name, name.length())) { ! return true; ! } } return false; Index: PyJavaPackage.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaPackage.java,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** PyJavaPackage.java 2001/10/28 17:13:43 2.16 --- PyJavaPackage.java 2001/12/21 00:18:12 2.17 *************** *** 136,143 **** if (ret != null) return ret; ! Class c; ! ! c = __mgr__.findClass(__name__,name); if (c != null) return addClass(name,c); --- 136,145 ---- if (ret != null) return ret; ! if (__mgr__.packageExists(__name__,name)) { ! __mgr__.notifyPackageImport(__name__,name); ! return addPackage(name); ! } + Class c = __mgr__.findClass(__name__,name); if (c != null) return addClass(name,c); *************** *** 149,157 **** return Py.None; - } - - if (__mgr__.packageExists(__name__,name)) { - __mgr__.notifyPackageImport(__name__,name); - return addPackage(name); } --- 151,154 ---- |
From: Samuele P. <ped...@us...> - 2001-12-20 22:45:14
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv23597 Modified Files: __builtin__.java Log Message: Fix for [ #484949 ] __import__(_) does unwanted rel search. Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** __builtin__.java 2001/12/16 13:04:02 2.40 --- __builtin__.java 2001/12/20 22:45:11 2.41 *************** *** 1007,1021 **** PyObject globals = (argc > 1 && args[1] != null) ! ? args[1] : __builtin__.globals(); ! PyObject locals = (argc > 2 && args[2] != null) ! ? args[2] : __builtin__.locals(); PyObject fromlist = (argc > 3 && args[3] != null) ? args[3] : Py.EmptyTuple; ! return load(module, globals, locals, fromlist); } private PyObject load(String module, ! PyObject globals, PyObject locals, PyObject fromlist) { --- 1007,1019 ---- PyObject globals = (argc > 1 && args[1] != null) ! ? args[1] : null; PyObject fromlist = (argc > 3 && args[3] != null) ? args[3] : Py.EmptyTuple; ! return load(module, globals, fromlist); } private PyObject load(String module, ! PyObject globals, PyObject fromlist) { |
From: Finn B. <bc...@us...> - 2001-12-20 18:36:00
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14813 Modified Files: javapath.py Log Message: Added expandvars() from CPython-2.1.1/lib/ntpath.py.. Index: javapath.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/javapath.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** javapath.py 2001/11/03 15:59:24 1.7 --- javapath.py 2001/12/20 18:35:58 1.8 *************** *** 13,17 **** # Missing: - # expandvars -- can't be bothered right now # sameopenfile -- Java doesn't have fstat nor file descriptors? # samestat -- How? --- 13,16 ---- *************** *** 239,241 **** --- 238,308 ---- f = File(path) return f.lastModified() / 1000.0 + + + # expandvars is stolen from CPython-2.1.1's Lib/ntpath.py: + + # Expand paths containing shell variable substitutions. + # The following rules apply: + # - no expansion within single quotes + # - no escape character, except for '$$' which is translated into '$' + # - ${varname} is accepted. + # - varnames can be made out of letters, digits and the character '_' + # XXX With COMMAND.COM you can use any characters in a variable name, + # XXX except '^|<>='. + + def expandvars(path): + """Expand shell variables of form $var and ${var}. + + Unknown variables are left unchanged.""" + if '$' not in path: + return path + import string + varchars = string.letters + string.digits + '_-' + res = '' + index = 0 + pathlen = len(path) + while index < pathlen: + c = path[index] + if c == '\'': # no expansion within single quotes + path = path[index + 1:] + pathlen = len(path) + try: + index = path.index('\'') + res = res + '\'' + path[:index + 1] + except ValueError: + res = res + path + index = pathlen - 1 + elif c == '$': # variable or '$$' + if path[index + 1:index + 2] == '$': + res = res + c + index = index + 1 + elif path[index + 1:index + 2] == '{': + path = path[index+2:] + pathlen = len(path) + try: + index = path.index('}') + var = path[:index] + if os.environ.has_key(var): + res = res + os.environ[var] + except ValueError: + res = res + path + index = pathlen - 1 + else: + var = '' + index = index + 1 + c = path[index:index + 1] + while c != '' and c in varchars: + var = var + c + index = index + 1 + c = path[index:index + 1] + if os.environ.has_key(var): + res = res + os.environ[var] + if c != '': + res = res + c + else: + res = res + c + index = index + 1 + return res + + |
From: Finn B. <bc...@us...> - 2001-12-20 18:29:53
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv13755 Modified Files: PySystemState.java Log Message: Update to 2.1b2. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.72 retrieving revision 2.73 diff -C2 -d -r2.72 -r2.73 *** PySystemState.java 2001/12/20 17:41:30 2.72 --- PySystemState.java 2001/12/20 18:29:51 2.73 *************** *** 18,22 **** * The current version of JPython. */ ! public static String version = "2.1b1"; private static int PY_MAJOR_VERSION = 2; --- 18,22 ---- * The current version of JPython. */ ! public static String version = "2.1b2"; private static int PY_MAJOR_VERSION = 2; *************** *** 24,28 **** private static int PY_MICRO_VERSION = 0; private static int PY_RELEASE_LEVEL = 0xB; ! private static int PY_RELEASE_SERIAL = 1; public static int hexversion = ((PY_MAJOR_VERSION << 24) | --- 24,28 ---- private static int PY_MICRO_VERSION = 0; private static int PY_RELEASE_LEVEL = 0xB; ! private static int PY_RELEASE_SERIAL = 2; public static int hexversion = ((PY_MAJOR_VERSION << 24) | |