Code

applied patch 688595
[roundup.git] / roundup / backends / __init__.py
index 1e0348b819096543a0b553b849948b41fbed00f3..7dfe3e8eebfbe063e3bd036a8857cf5858a43183 100644 (file)
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: __init__.py,v 1.13 2002-07-11 01:11:03 richard Exp $
+# $Id: __init__.py,v 1.21 2003-01-12 23:53:19 richard Exp $
+
+''' Container for the hyperdb storage backend implementations.
+
+The __all__ variable is constructed containing only the backends which are
+available.
+'''
 
 __all__ = []
 
@@ -36,6 +42,38 @@ else:
     anydbm = back_anydbm
     __all__.append('anydbm')
 
+try:
+    import gadfly
+    import gadfly.client
+except ImportError, message:
+    if str(message) == 'No module named client':
+        # don't keep the old gadfly around
+        del gadfly
+    elif str(message) != 'No module named gadfly':
+        raise
+else:
+    import back_gadfly
+    gadfly = back_gadfly
+    __all__.append('gadfly')
+
+try:
+    import MySQLdb
+except ImportError, message:
+    if str(message) != 'No module named MySQLdb': raise
+else:
+    import back_mysql
+    mysql = back_mysql
+    __all__.append('mysql')
+
+try:
+    import sqlite
+except ImportError, message:
+    if str(message) != 'No module named sqlite': raise
+else:
+    import back_sqlite
+    sqlite = back_sqlite
+    __all__.append('sqlite')
+
 try:
     import bsddb
 except ImportError, message:
@@ -63,57 +101,4 @@ else:
     metakit = back_metakit
     __all__.append('metakit')
 
-#
-# $Log: not supported by cvs2svn $
-# Revision 1.12  2002/05/22 00:32:33  richard
-#  . changed the default message list in issues to display the message body
-#  . made backends.__init__ be more specific about which ImportErrors it really
-#    wants to ignore
-#  . fixed the example addresses in the templates to use correct example domains
-#  . cleaned out the template stylesheets, removing a bunch of junk that really
-#    wasn't necessary (font specs, styles never used) and added a style for
-#    message content
-#
-# Revision 1.11  2002/02/16 08:39:42  richard
-#  . #516854 ] "My Issues" and redisplay
-#
-# Revision 1.10  2002/01/22 07:08:50  richard
-# I was certain I'd already done this (there's even a change note in
-# CHANGES)...
-#
-# Revision 1.9  2001/12/12 02:30:51  richard
-# I fixed the problems with people whose anydbm was using the dbm module at the
-# backend. It turns out the dbm module modifies the file name to append ".db"
-# and my check to determine if we're opening an existing or new db just
-# tested os.path.exists() on the filename. Well, no longer! We now perform a
-# much better check _and_ cope with the anydbm implementation module changing
-# too!
-# I also fixed the backends __init__ so only ImportError is squashed.
-#
-# Revision 1.8  2001/12/10 22:20:01  richard
-# Enabled transaction support in the bsddb backend. It uses the anydbm code
-# where possible, only replacing methods where the db is opened (it uses the
-# btree opener specifically.)
-# Also cleaned up some change note generation.
-# Made the backends package work with pydoc too.
-#
-# Revision 1.7  2001/12/10 00:57:38  richard
-# From CHANGES:
-#  . Added the "display" command to the admin tool - displays a node's values
-#  . #489760 ] [issue] only subject
-#  . fixed the doc/index.html to include the quoting in the mail alias.
-#
-# Also:
-#  . fixed roundup-admin so it works with transactions
-#  . disabled the back_anydbm module if anydbm tries to use dumbdbm
-#
-# Revision 1.6  2001/08/07 00:24:42  richard
-# stupid typo
-#
-# Revision 1.5  2001/08/07 00:15:51  richard
-# Added the copyright/license notice to (nearly) all files at request of
-# Bizar Software.
-#
-#
-#
 # vim: set filetype=python ts=4 sw=4 et si