Mercurial > p > roundup > code
annotate roundup/backends/__init__.py @ 854:3cdfa5d86cec
Added metakit backend to the db tests...
...and fixed the more easily fixable test failures.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 11 Jul 2002 01:11:03 +0000 |
| parents | 65234f56b250 |
| children | 07d8a4e296f8 |
| rev | line source |
|---|---|
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
1 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
3 # This module is free software, and you may redistribute it and/or modify |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
4 # under the same terms as Python, so long as this copyright message and |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
5 # disclaimer are retained in their original form. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
6 # |
| 214 | 7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
10 # POSSIBILITY OF SUCH DAMAGE. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
11 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
17 # |
|
854
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
18 # $Id: __init__.py,v 1.13 2002-07-11 01:11:03 richard Exp $ |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
19 |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
20 __all__ = [] |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
21 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
22 try: |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
23 import sys, anydbm |
|
569
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
24 if not hasattr(sys, 'version_info') or sys.version_info < (2,1,2): |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
25 import dumbdbm |
|
569
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
26 # dumbdbm only works in python 2.1.2+ |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
27 assert anydbm._defaultmod != dumbdbm |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
28 del anydbm |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
29 del dumbdbm |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
30 except AssertionError: |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
31 print "WARNING: you should upgrade to python 2.1.3" |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
32 except ImportError, message: |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
33 if str(message) != 'No module named anydbm': raise |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
34 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
35 import back_anydbm |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
36 anydbm = back_anydbm |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
37 __all__.append('anydbm') |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
42
diff
changeset
|
38 |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
39 try: |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
40 import bsddb |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
41 except ImportError, message: |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
42 if str(message) != 'No module named bsddb': raise |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
43 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
44 import back_bsddb |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
45 bsddb = back_bsddb |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
46 __all__.append('bsddb') |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
47 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
48 try: |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
49 import bsddb3 |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
50 except ImportError, message: |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
51 if str(message) != 'No module named bsddb3': raise |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
52 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
53 import back_bsddb3 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
54 bsddb3 = back_bsddb3 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
55 __all__.append('bsddb3') |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
56 |
|
854
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
57 try: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
58 import metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
59 except ImportError, message: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
60 if str(message) != 'No module named metakit': raise |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
61 else: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
62 import back_metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
63 metakit = back_metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
64 __all__.append('metakit') |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
65 |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
66 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
67 # $Log: not supported by cvs2svn $ |
|
854
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
68 # Revision 1.12 2002/05/22 00:32:33 richard |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
69 # . changed the default message list in issues to display the message body |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
70 # . made backends.__init__ be more specific about which ImportErrors it really |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
71 # wants to ignore |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
72 # . fixed the example addresses in the templates to use correct example domains |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
73 # . cleaned out the template stylesheets, removing a bunch of junk that really |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
74 # wasn't necessary (font specs, styles never used) and added a style for |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
75 # message content |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
76 # |
|
733
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
77 # Revision 1.11 2002/02/16 08:39:42 richard |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
78 # . #516854 ] "My Issues" and redisplay |
|
65234f56b250
changed the default message list in issues to display the message body
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
79 # |
|
621
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
569
diff
changeset
|
80 # Revision 1.10 2002/01/22 07:08:50 richard |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
569
diff
changeset
|
81 # I was certain I'd already done this (there's even a change note in |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
569
diff
changeset
|
82 # CHANGES)... |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
569
diff
changeset
|
83 # |
|
569
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
84 # Revision 1.9 2001/12/12 02:30:51 richard |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
85 # I fixed the problems with people whose anydbm was using the dbm module at the |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
86 # backend. It turns out the dbm module modifies the file name to append ".db" |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
87 # and my check to determine if we're opening an existing or new db just |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
88 # tested os.path.exists() on the filename. Well, no longer! We now perform a |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
89 # much better check _and_ cope with the anydbm implementation module changing |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
90 # too! |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
91 # I also fixed the backends __init__ so only ImportError is squashed. |
|
d426d44abd3c
I was certain I'd already done this (there's even a change note in CHANGES).
Richard Jones <richard@users.sourceforge.net>
parents:
443
diff
changeset
|
92 # |
|
443
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
93 # Revision 1.8 2001/12/10 22:20:01 richard |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
94 # Enabled transaction support in the bsddb backend. It uses the anydbm code |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
95 # where possible, only replacing methods where the db is opened (it uses the |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
96 # btree opener specifically.) |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
97 # Also cleaned up some change note generation. |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
98 # Made the backends package work with pydoc too. |
|
a0c598702f17
I fixed the problems with anydbm using the dbm module at the backend.
Richard Jones <richard@users.sourceforge.net>
parents:
440
diff
changeset
|
99 # |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
100 # Revision 1.7 2001/12/10 00:57:38 richard |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
101 # From CHANGES: |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
102 # . Added the "display" command to the admin tool - displays a node's values |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
103 # . #489760 ] [issue] only subject |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
104 # . fixed the doc/index.html to include the quoting in the mail alias. |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
105 # |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
106 # Also: |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
107 # . fixed roundup-admin so it works with transactions |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
108 # . disabled the back_anydbm module if anydbm tries to use dumbdbm |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
109 # |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
110 # Revision 1.6 2001/08/07 00:24:42 richard |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
111 # stupid typo |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
112 # |
| 214 | 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. | |
| 116 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
117 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
118 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
119 # vim: set filetype=python ts=4 sw=4 et si |
