Code

documentation cleanup
[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.26 2004-02-11 23:55:08 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 '''
25 __docformat__ = 'restructuredtext'
27 __all__ = []
29 for backend in ['anydbm', ('mysql', 'MySQLdb'), 'bsddb', 'bsddb3', 'sqlite',
30                 'metakit', ('postgresql', 'psycopg')]:
31     if len(backend) == 2:
32         backend, backend_module = backend
33     else:
34         backend_module = backend
35     try:
36         globals()[backend] = __import__('back_%s'%backend, globals())
37         __all__.append(backend)
38     except ImportError, e:
39         if not str(e).startswith('No module named %s'%backend_module):
40             raise
42 # vim: set filetype=python ts=4 sw=4 et si