X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fbackends%2F__init__.py;h=ee73759d26ceb41a003f90111d56fa3b65c2c4c9;hb=111ccd0816bc9eb34a62b1d9f6dd98c50458bc46;hp=737e9f2821e32ca047f4ae7ea376a283b954abe5;hpb=c853df7b1fb5c3deee55fd7c8396f56259b060f6;p=roundup.git diff --git a/roundup/backends/__init__.py b/roundup/backends/__init__.py index 737e9f2..ee73759 100644 --- a/roundup/backends/__init__.py +++ b/roundup/backends/__init__.py @@ -4,7 +4,7 @@ # under the same terms as Python, so long as this copyright message and # disclaimer are retained in their original form. # -# IN NO EVENT SHALL THE BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR +# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. @@ -15,37 +15,87 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: __init__.py,v 1.5 2001-08-07 00:15:51 richard Exp $ +# $Id: __init__.py,v 1.12 2002-05-22 00:32:33 richard Exp $ __all__ = [] try: + import sys, anydbm + if not hasattr(sys, 'version_info') or sys.version_info < (2,1,2): + import dumbdbm + # dumbdbm only works in python 2.1.2+ + assert anydbm._defaultmod != dumbdbm + del anydbm + del dumbdbm +except AssertionError: + print "WARNING: you should upgrade to python 2.1.3" +except ImportError, message: + if str(message) != 'No module named anydbm': raise +else: import back_anydbm anydbm = back_anydbm - del back_anydbm __all__.append('anydbm') -except: - pass try: + import bsddb +except ImportError, message: + if str(message) != 'No module named bsddb': raise +else: import back_bsddb bsddb = back_bsddb - del back_bsddb __all__.append('bsddb') -except: - pass try: + import bsddb3 +except ImportError, message: + if str(message) != 'No module named bsddb3': raise +else: import back_bsddb3 bsddb3 = back_bsddb3 - del back_bsddb3 __all__.append('bsddb3') -except: - pass - # # $Log: not supported by cvs2svn $ +# Revision 1.11 2002/02/16 08:39:42 richard +# . #516854 ] "My Issues" and redisplay +# +# Revision 1.10 2002/01/22 07:08:50 richard +# I was certain I'd already done this (there's even a change note in +# CHANGES)... +# +# Revision 1.9 2001/12/12 02:30:51 richard +# I fixed the problems with people whose anydbm was using the dbm module at the +# backend. It turns out the dbm module modifies the file name to append ".db" +# and my check to determine if we're opening an existing or new db just +# tested os.path.exists() on the filename. Well, no longer! We now perform a +# much better check _and_ cope with the anydbm implementation module changing +# too! +# I also fixed the backends __init__ so only ImportError is squashed. +# +# Revision 1.8 2001/12/10 22:20:01 richard +# Enabled transaction support in the bsddb backend. It uses the anydbm code +# where possible, only replacing methods where the db is opened (it uses the +# btree opener specifically.) +# Also cleaned up some change note generation. +# Made the backends package work with pydoc too. +# +# Revision 1.7 2001/12/10 00:57:38 richard +# From CHANGES: +# . Added the "display" command to the admin tool - displays a node's values +# . #489760 ] [issue] only subject +# . fixed the doc/index.html to include the quoting in the mail alias. +# +# Also: +# . fixed roundup-admin so it works with transactions +# . disabled the back_anydbm module if anydbm tries to use dumbdbm +# +# Revision 1.6 2001/08/07 00:24:42 richard +# stupid typo +# +# Revision 1.5 2001/08/07 00:15:51 richard +# Added the copyright/license notice to (nearly) all files at request of +# Bizar Software. +# # # # vim: set filetype=python ts=4 sw=4 et si