Code

Added metakit backend to the db tests and fixed the more easily fixable test
[roundup.git] / roundup / backends / __init__.py
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.13 2002-07-11 01:11:03 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 try:
58     import metakit
59 except ImportError, message:
60     if str(message) != 'No module named metakit': raise
61 else:
62     import back_metakit
63     metakit = back_metakit
64     __all__.append('metakit')
66 #
67 # $Log: not supported by cvs2svn $
68 # Revision 1.12  2002/05/22 00:32:33  richard
69 #  . changed the default message list in issues to display the message body
70 #  . made backends.__init__ be more specific about which ImportErrors it really
71 #    wants to ignore
72 #  . fixed the example addresses in the templates to use correct example domains
73 #  . cleaned out the template stylesheets, removing a bunch of junk that really
74 #    wasn't necessary (font specs, styles never used) and added a style for
75 #    message content
76 #
77 # Revision 1.11  2002/02/16 08:39:42  richard
78 #  . #516854 ] "My Issues" and redisplay
79 #
80 # Revision 1.10  2002/01/22 07:08:50  richard
81 # I was certain I'd already done this (there's even a change note in
82 # CHANGES)...
83 #
84 # Revision 1.9  2001/12/12 02:30:51  richard
85 # I fixed the problems with people whose anydbm was using the dbm module at the
86 # backend. It turns out the dbm module modifies the file name to append ".db"
87 # and my check to determine if we're opening an existing or new db just
88 # tested os.path.exists() on the filename. Well, no longer! We now perform a
89 # much better check _and_ cope with the anydbm implementation module changing
90 # too!
91 # I also fixed the backends __init__ so only ImportError is squashed.
92 #
93 # Revision 1.8  2001/12/10 22:20:01  richard
94 # Enabled transaction support in the bsddb backend. It uses the anydbm code
95 # where possible, only replacing methods where the db is opened (it uses the
96 # btree opener specifically.)
97 # Also cleaned up some change note generation.
98 # Made the backends package work with pydoc too.
99 #
100 # Revision 1.7  2001/12/10 00:57:38  richard
101 # From CHANGES:
102 #  . Added the "display" command to the admin tool - displays a node's values
103 #  . #489760 ] [issue] only subject
104 #  . fixed the doc/index.html to include the quoting in the mail alias.
106 # Also:
107 #  . fixed roundup-admin so it works with transactions
108 #  . disabled the back_anydbm module if anydbm tries to use dumbdbm
110 # Revision 1.6  2001/08/07 00:24:42  richard
111 # stupid typo
113 # Revision 1.5  2001/08/07 00:15:51  richard
114 # Added the copyright/license notice to (nearly) all files at request of
115 # Bizar Software.
119 # vim: set filetype=python ts=4 sw=4 et si