1 #
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10 # POSSIBILITY OF SUCH DAMAGE.
11 #
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 #
18 # $Id: __init__.py,v 1.20 2002-10-07 00:52:51 richard Exp $
20 ''' Container for the hyperdb storage backend implementations.
22 The __all__ variable is constructed containing only the backends which are
23 available.
24 '''
26 __all__ = []
28 try:
29 import sys, anydbm
30 if not hasattr(sys, 'version_info') or sys.version_info < (2,1,2):
31 import dumbdbm
32 # dumbdbm only works in python 2.1.2+
33 assert anydbm._defaultmod != dumbdbm
34 del anydbm
35 del dumbdbm
36 except AssertionError:
37 print "WARNING: you should upgrade to python 2.1.3"
38 except ImportError, message:
39 if str(message) != 'No module named anydbm': raise
40 else:
41 import back_anydbm
42 anydbm = back_anydbm
43 __all__.append('anydbm')
45 try:
46 import gadfly
47 import gadfly.client
48 except ImportError, message:
49 if str(message) == 'No module named client':
50 # don't keep the old gadfly around
51 del gadfly
52 elif str(message) != 'No module named gadfly':
53 raise
54 else:
55 import back_gadfly
56 gadfly = back_gadfly
57 __all__.append('gadfly')
59 try:
60 import sqlite
61 except ImportError, message:
62 if str(message) != 'No module named sqlite': raise
63 else:
64 import back_sqlite
65 sqlite = back_sqlite
66 __all__.append('sqlite')
68 try:
69 import bsddb
70 except ImportError, message:
71 if str(message) != 'No module named bsddb': raise
72 else:
73 import back_bsddb
74 bsddb = back_bsddb
75 __all__.append('bsddb')
77 try:
78 import bsddb3
79 except ImportError, message:
80 if str(message) != 'No module named bsddb3': raise
81 else:
82 import back_bsddb3
83 bsddb3 = back_bsddb3
84 __all__.append('bsddb3')
86 try:
87 import metakit
88 except ImportError, message:
89 if str(message) != 'No module named metakit': raise
90 else:
91 import back_metakit
92 metakit = back_metakit
93 __all__.append('metakit')
95 # vim: set filetype=python ts=4 sw=4 et si