changeset 2216:28d8d384d24d

fixed xapian.open/xapian.WritableDataBase to work with both xapian 0.9.x and 1.0.0
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 21 Jun 2007 09:23:44 +0200
parents c00b5f8d211f
children f8dcc3232e8b
files MoinMoin/support/xapwrap/index.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/xapwrap/index.py	Sat May 26 16:53:46 2007 +0200
+++ b/MoinMoin/support/xapwrap/index.py	Thu Jun 21 09:23:44 2007 +0200
@@ -308,7 +308,10 @@
                     db.add_database(xapian.Database(path))
                 return klass(db)
             else:
-                return klass(xapian.WriteableDatabase(*args, **kwargs))
+                try:
+                    return klass(xapian.WritableDatabase(*args, **kwargs)) # for xapian 1.0+
+                except AttributeError:
+                    return klass(xapian.open(*args, **kwargs)) # for xapian 0.9.x
         except (IOError, RuntimeError, ValueError), e:
             errorMsg = e.args[0]
             for subString, exceptionClass in klass.exceptionStrMap.iteritems():