X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fbackends%2F__init__.py;h=b5e38c013a31bfa3143f486a90c25e1c4d1c69db;hb=8c7c3ac5b665acdbfdf0e6643c4666140934d725;hp=2c181a2e3d1f55e727c08b42ba4e83ffc28a74b1;hpb=514e7a08ff789dc6958b137690533c8951efab31;p=roundup.git diff --git a/roundup/backends/__init__.py b/roundup/backends/__init__.py index 2c181a2..b5e38c0 100644 --- a/roundup/backends/__init__.py +++ b/roundup/backends/__init__.py @@ -15,40 +15,105 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: __init__.py,v 1.8 2001-12-10 22:20:01 richard Exp $ +# $Id: __init__.py,v 1.15 2002-08-23 04:48:10 richard Exp $ __all__ = [] try: - import anydbm, dumbdbm - # dumbdbm in python 2,2b2, 2.1.1 and earlier is seriously broken - assert anydbm._defaultmod != dumbdbm - del anydbm - del dumbdbm + 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 __all__.append('anydbm') -except AssertionError: - del back_anydbm -except: - pass try: + import gadfly +except ImportError, message: + if str(message) != 'No module named gadfly': raise +else: + import back_gadfly + gadfly = back_gadfly + __all__.append('gadfly') + +try: + import bsddb +except ImportError, message: + if str(message) != 'No module named bsddb': raise +else: import back_bsddb bsddb = 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 __all__.append('bsddb3') -except: - pass + +try: + import metakit +except ImportError, message: + if str(message) != 'No module named metakit': raise +else: + import back_metakit + metakit = back_metakit + __all__.append('metakit') # # $Log: not supported by cvs2svn $ +# Revision 1.14 2002/08/22 07:56:51 richard +# Whee! It's not finished yet, but I can create a new instance and play with +# it a little bit :) +# +# Revision 1.13 2002/07/11 01:11:03 richard +# Added metakit backend to the db tests and fixed the more easily fixable test +# failures. +# +# Revision 1.12 2002/05/22 00:32:33 richard +# . changed the default message list in issues to display the message body +# . made backends.__init__ be more specific about which ImportErrors it really +# wants to ignore +# . fixed the example addresses in the templates to use correct example domains +# . cleaned out the template stylesheets, removing a bunch of junk that really +# wasn't necessary (font specs, styles never used) and added a style for +# message content +# +# 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