changeset 2222:90484c86443a

xapian: handling of deprecated get_description
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 26 May 2007 19:56:30 +0200
parents f5b9f51e67a9
children eec3c7b6a686
files MoinMoin/search/builtin.py MoinMoin/support/xapwrap/index.py
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/builtin.py	Sat May 26 19:12:16 2007 +0200
+++ b/MoinMoin/search/builtin.py	Sat May 26 19:56:30 2007 +0200
@@ -515,8 +515,11 @@
 
                 clock.start('_xapianQuery')
                 query = self.query.xapian_term(self.request, index.allterms)
-                logging.info("xapianSearch: query = %r" %
-                        query.get_description())
+                try:
+                    description = query.get_description() # deprecated since xapian 1.0, removal in 1.1
+                except AttributeError:
+                    description = str(query)
+                logging.info("xapianSearch: query = %r" % description)
                 query = xapwrap.index.QObjQuery(query)
                 enq, mset, hits = index.search(query, sort=self.sort,
                         historysearch=self.historysearch)
--- a/MoinMoin/support/xapwrap/index.py	Sat May 26 19:12:16 2007 +0200
+++ b/MoinMoin/support/xapwrap/index.py	Sat May 26 19:56:30 2007 +0200
@@ -585,7 +585,10 @@
         q = query.prepare(self.qp)
         # uggg. this mess is due to the fact that xapain Query objects
         # don't hash in a sane way.
-        qString = q.get_description()
+        try:
+            qString = q.get_description() # deprecated since xapian 1.0, removal in 1.1
+        except AttributeError:
+            qString = str(q)
 
         # the only thing we use sortKey for is to set sort index
         if sortKey is not None: