changeset 1279:835c392be95d

improvements for SystemInfo macro
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Mon, 14 Aug 2006 23:28:54 +0200
parents 135aa02138b7
children 6d5d345599a1
files MoinMoin/macro/SystemInfo.py
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/SystemInfo.py	Mon Aug 14 17:26:28 2006 +0200
+++ b/MoinMoin/macro/SystemInfo.py	Mon Aug 14 23:28:54 2006 +0200
@@ -115,14 +115,18 @@
     from MoinMoin.search.builtin import Search
     xapState = (_('Disabled'), _('Enabled'))
     idxState = (_('index available'), _('index unavailable'))
-    idx = Search._xapianIndex(request)
-    available = idx and idxState[0] or idxState[1]
-    mtime = _('last modified: %s') % (idx and
-            request.user.getFormattedDateTime(
-                wikiutil.version2timestamp(idx.mtime())) or
-                _('N/A'))
-    row(_('Xapian search'), '%s, %s, %s'
-            % (xapState[request.cfg.xapian_search], available, mtime))
+    out = xapState[request.cfg.xapian_search]
+
+    if request.cfg.xapian_search:
+        idx = Search._xapianIndex(request)
+        available = idx and idxState[0] or idxState[1]
+        mtime = _('last modified: %s') % (idx and
+                request.user.getFormattedDateTime(
+                    wikiutil.version2timestamp(idx.mtime())) or
+                    _('N/A'))
+        out += ', %s, %s' % (available, mtime)
+
+    row(_('Xapian search'), out)
     row(_('Xapian stemming'), xapState[request.cfg.xapian_stemming])
 
     row(_('Active threads'), t_count or _('N/A'))