changeset 1498:2807382fec1f

fix xapian version if xapian is not installed
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sat, 26 Aug 2006 18:47:58 +0200
parents ed3845759431
children ffa0d1f81059
files MoinMoin/macro/SystemInfo.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/SystemInfo.py	Sat Aug 26 18:21:54 2006 +0200
+++ b/MoinMoin/macro/SystemInfo.py	Sat Aug 26 18:47:58 2006 +0200
@@ -113,7 +113,6 @@
         ', '.join(wikiutil.wikiPlugins('parser', Macro.cfg)) or nonestr)
 
     from MoinMoin.search.builtin import Search
-    import xapian
     xapState = (_('Disabled'), _('Enabled'))
     idxState = (_('index available'), _('index unavailable'))
     xapRow = xapState[request.cfg.xapian_search]
@@ -127,8 +126,13 @@
                     _('N/A'))
         xapRow += ', %s, %s' % (available, mtime)
 
+        import xapian
+        xapVersion = xapian.xapian_version_string()
+    else:
+        xapVersion = _('not installed')
+
     row(_('Xapian search'), xapRow)
-    row(_('Xapian Version'), xapian.xapian_version_string())
+    row(_('Xapian Version'), xapVersion)
     row(_('Xapian stemming'), xapState[request.cfg.xapian_stemming])
 
     row(_('Active threads'), t_count or _('N/A'))