Mercurial > p > roundup > code
annotate roundup/backends/__init__.py @ 1244:8dd4f736370b
merge from maintenance branch
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 03 Oct 2002 06:56:30 +0000 |
| parents | 268a443067fb |
| children | 6c24a86a12ae |
| 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 # |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
18 # $Id: __init__.py,v 1.19 2002-10-03 06:56:29 richard Exp $ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
19 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
20 ''' Container for the hyperdb storage backend implementations. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
21 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
22 The __all__ variable is constructed containing only the backends which are |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
23 available. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1190
diff
changeset
|
24 ''' |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
25 |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
26 __all__ = [] |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
27 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
28 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
|
29 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
|
30 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
|
31 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
|
32 # 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
|
33 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
|
34 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
|
35 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
|
36 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
|
37 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
|
38 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
|
39 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
|
40 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
41 import back_anydbm |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
42 anydbm = back_anydbm |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
43 __all__.append('anydbm') |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
42
diff
changeset
|
44 |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
45 try: |
|
968
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
46 import gadfly |
|
1190
268a443067fb
better detection of a useful gadfly
Richard Jones <richard@users.sourceforge.net>
parents:
1165
diff
changeset
|
47 import gadfly.client |
|
968
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
48 except ImportError, message: |
|
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
49 if str(message) != 'No module named gadfly': raise |
|
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
50 else: |
|
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
51 import back_gadfly |
|
972
ca0a542b2d19
That's gadfly done, mostly.
Richard Jones <richard@users.sourceforge.net>
parents:
968
diff
changeset
|
52 gadfly = back_gadfly |
|
968
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
53 __all__.append('gadfly') |
|
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
54 |
|
07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
Richard Jones <richard@users.sourceforge.net>
parents:
854
diff
changeset
|
55 try: |
|
1165
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
56 import sqlite |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
57 except ImportError, message: |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
58 if str(message) != 'No module named sqlite': raise |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
59 else: |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
60 import back_sqlite |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
61 sqlite = back_sqlite |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
62 __all__.append('sqlite') |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
63 |
|
14467c765167
sqlite backend!
Richard Jones <richard@users.sourceforge.net>
parents:
1088
diff
changeset
|
64 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
|
65 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
|
66 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
|
67 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
|
68 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
69 import back_bsddb |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
70 bsddb = back_bsddb |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
71 __all__.append('bsddb') |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
72 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
73 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
|
74 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
|
75 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
|
76 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
|
77 else: |
|
159
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
78 import back_bsddb3 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
79 bsddb3 = back_bsddb3 |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
80 __all__.append('bsddb3') |
|
764db91c0dea
Checks for ability to import the specific back-end module.
Richard Jones <richard@users.sourceforge.net>
parents:
46
diff
changeset
|
81 |
|
854
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
82 try: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
83 import metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
84 except ImportError, message: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
85 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
|
86 else: |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
87 import back_metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
88 metakit = back_metakit |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
89 __all__.append('metakit') |
|
3cdfa5d86cec
Added metakit backend to the db tests...
Richard Jones <richard@users.sourceforge.net>
parents:
733
diff
changeset
|
90 |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
159
diff
changeset
|
91 # vim: set filetype=python ts=4 sw=4 et si |
