Update of /cvsroot/python/python/dist/src/Lib/bsddb In directory sc8-pr-cvs1:/tmp/cvs-serv14110/bsddb Modified Files: __init__.py db.py dbshelve.py dbtables.py dbutils.py Log Message: Adds basic support for BerkeleyDB 4.2.x. Compiles and passes tests; new features in BerkeleyDB not exposed. notably: the DB_MPOOLFILE interface has not yet been wrapped in an object. Adds support for building and installing bsddb3 in python2.3 that has an older version of this module installed as bsddb without conflicts. The pybsddb.sf.net build/packaged version of the module uses a dynamicly loadable module called _pybsddb rather than _bsddb. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** __init__.py 20 Sep 2003 23:51:34 -0000 1.8 --- __init__.py 21 Sep 2003 00:08:14 -0000 1.9 *************** *** 34,42 **** ! """Support for BerkeleyDB 3.1 through 4.1. """ try: ! import _bsddb except ImportError: # Remove ourselves from sys.modules --- 34,49 ---- ! """Support for BerkeleyDB 3.2 through 4.2. """ try: ! if __name__ == 'bsddb3': ! # import _pybsddb binary as it should be the more recent version from ! # a standalone pybsddb addon package than the version included with ! # python as bsddb._bsddb. ! import _pybsddb ! _bsddb = _pybsddb ! else: ! import _bsddb except ImportError: # Remove ourselves from sys.modules Index: db.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/db.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db.py 19 Nov 2002 17:48:48 -0000 1.2 --- db.py 21 Sep 2003 00:08:14 -0000 1.3 *************** *** 38,44 **** # it just simply imports everything from _db. ! from _bsddb import * ! from _bsddb import __version__ ! if version() < (3, 1, 0): ! raise ImportError, "BerkeleyDB 3.x symbols not found. Perhaps python was statically linked with an older version?" --- 38,51 ---- # it just simply imports everything from _db. ! if __name__[:len('bsddb3.')] == 'bsddb3.': ! # import _pybsddb binary as it should be the more recent version from ! # a standalone pybsddb addon package than the version included with ! # python as bsddb._bsddb. ! from _pybsddb import * ! from _pybsddb import __version__ ! else: ! from _bsddb import * ! from _bsddb import __version__ ! if version() < (3, 2, 0): ! raise ImportError, "correct BerkeleyDB symbols not found. Perhaps python was statically linked with an older version?" Index: dbshelve.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbshelve.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dbshelve.py 24 Apr 2003 16:02:46 -0000 1.8 --- dbshelve.py 21 Sep 2003 00:08:14 -0000 1.9 *************** *** 36,45 **** # DictMixin is new in Python 2.3 class DictMixin: pass ! try: ! # For Python 2.3 ! from bsddb import db ! except ImportError: ! # For earlier Pythons w/distutils pybsddb ! from bsddb3 import db #------------------------------------------------------------------------ --- 36,40 ---- # DictMixin is new in Python 2.3 class DictMixin: pass ! import db #------------------------------------------------------------------------ Index: dbtables.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbtables.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dbtables.py 9 Jul 2003 04:45:59 -0000 1.8 --- dbtables.py 21 Sep 2003 00:08:14 -0000 1.9 *************** *** 27,35 **** try: # For Python 2.3 from bsddb.db import * - except ImportError: - # For earlier Pythons w/distutils pybsddb - from bsddb3.db import * --- 27,35 ---- try: + # For Pythons w/distutils pybsddb + from bsddb3.db import * + except ImportError: # For Python 2.3 from bsddb.db import * Index: dbutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbutils.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dbutils.py 28 Jan 2003 17:20:42 -0000 1.6 --- dbutils.py 21 Sep 2003 00:08:14 -0000 1.7 *************** *** 27,36 **** from time import sleep as _sleep ! try: ! # For Python 2.3 ! from bsddb import db ! except ImportError: ! # For earlier Pythons w/distutils pybsddb ! from bsddb3 import db # always sleep at least N seconds between retrys --- 27,31 ---- from time import sleep as _sleep ! import db # always sleep at least N seconds between retrys