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.12 2002-05-22 00:32:33 richard Exp $
20 __all__ = []
22 try:
23 import sys, anydbm
24 if not hasattr(sys, 'version_info') or sys.version_info < (2,1,2):
25 import dumbdbm
26 # dumbdbm only works in python 2.1.2+
27 assert anydbm._defaultmod != dumbdbm
28 del anydbm
29 del dumbdbm
30 except AssertionError:
31 print "WARNING: you should upgrade to python 2.1.3"
32 except ImportError, message:
33 if str(message) != 'No module named anydbm': raise
34 else:
35 import back_anydbm
36 anydbm = back_anydbm
37 __all__.append('anydbm')
39 try:
40 import bsddb
41 except ImportError, message:
42 if str(message) != 'No module named bsddb': raise
43 else:
44 import back_bsddb
45 bsddb = back_bsddb
46 __all__.append('bsddb')
48 try:
49 import bsddb3
50 except ImportError, message:
51 if str(message) != 'No module named bsddb3': raise
52 else:
53 import back_bsddb3
54 bsddb3 = back_bsddb3
55 __all__.append('bsddb3')
57 #
58 # $Log: not supported by cvs2svn $
59 # Revision 1.11 2002/02/16 08:39:42 richard
60 # . #516854 ] "My Issues" and redisplay
61 #
62 # Revision 1.10 2002/01/22 07:08:50 richard
63 # I was certain I'd already done this (there's even a change note in
64 # CHANGES)...
65 #
66 # Revision 1.9 2001/12/12 02:30:51 richard
67 # I fixed the problems with people whose anydbm was using the dbm module at the
68 # backend. It turns out the dbm module modifies the file name to append ".db"
69 # and my check to determine if we're opening an existing or new db just
70 # tested os.path.exists() on the filename. Well, no longer! We now perform a
71 # much better check _and_ cope with the anydbm implementation module changing
72 # too!
73 # I also fixed the backends __init__ so only ImportError is squashed.
74 #
75 # Revision 1.8 2001/12/10 22:20:01 richard
76 # Enabled transaction support in the bsddb backend. It uses the anydbm code
77 # where possible, only replacing methods where the db is opened (it uses the
78 # btree opener specifically.)
79 # Also cleaned up some change note generation.
80 # Made the backends package work with pydoc too.
81 #
82 # Revision 1.7 2001/12/10 00:57:38 richard
83 # From CHANGES:
84 # . Added the "display" command to the admin tool - displays a node's values
85 # . #489760 ] [issue] only subject
86 # . fixed the doc/index.html to include the quoting in the mail alias.
87 #
88 # Also:
89 # . fixed roundup-admin so it works with transactions
90 # . disabled the back_anydbm module if anydbm tries to use dumbdbm
91 #
92 # Revision 1.6 2001/08/07 00:24:42 richard
93 # stupid typo
94 #
95 # Revision 1.5 2001/08/07 00:15:51 richard
96 # Added the copyright/license notice to (nearly) all files at request of
97 # Bizar Software.
98 #
99 #
100 #
101 # vim: set filetype=python ts=4 sw=4 et si