changeset 917:04c4f745620f

small cleanup in stemmer import & availability handling
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Thu, 22 Jun 2006 12:39:59 +0200
parents d0af8dce4d0e
children d9bd5d6ae30d
files MoinMoin/Xapian.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Xapian.py	Thu Jun 22 00:40:06 2006 +0200
+++ b/MoinMoin/Xapian.py	Thu Jun 22 12:39:59 2006 +0200
@@ -24,9 +24,8 @@
 try:
     # PyStemmer, snowball python bindings from http://snowball.tartarus.org/
     from Stemmer import Stemmer
-    stemmer_available = True
 except ImportError:
-    stemmer_available = False
+    Stemmer = None
 
 class UnicodeQuery(xapian.Query):
     def __init__(self, *args, **kwargs):
@@ -304,7 +303,7 @@
         ##    self.indexPagesInNewThread(request)
 
         # Check if we should and can stem words
-        if request.cfg.xapian_stemming and not stemmer_available:
+        if request.cfg.xapian_stemming and not Stemmer:
             request.cfg.xapian_stemming = False
 
     def _main_dir(self):