changeset 1205:73f576c4bca3

fix multiconfig merge and more informative SystemInfo macro
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Mon, 24 Jul 2006 14:18:55 +0200
parents 9085983fc624
children a9ffe6479012
files MoinMoin/config/multiconfig.py MoinMoin/macro/SystemInfo.py MoinMoin/search/Xapian.py MoinMoin/search/builtin.py
diffstat 4 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Mon Jul 24 11:52:07 2006 +0200
+++ b/MoinMoin/config/multiconfig.py	Mon Jul 24 14:18:55 2006 +0200
@@ -295,6 +295,7 @@
     xapian_search = False # disabled until xapian is finished
     xapian_index_dir = None
     xapian_stemming = True
+    search_results_per_page = 10
 
     mail_login = None # or "user pwd" if you need to use SMTP AUTH
     mail_sendmail = None # "/usr/sbin/sendmail -t -i" to not use SMTP, but sendmail
--- a/MoinMoin/macro/SystemInfo.py	Mon Jul 24 11:52:07 2006 +0200
+++ b/MoinMoin/macro/SystemInfo.py	Mon Jul 24 14:18:55 2006 +0200
@@ -17,6 +17,7 @@
 from MoinMoin import action, macro, parser
 from MoinMoin.logfile import editlog, eventlog
 from MoinMoin.Page import Page
+from MoinMoin.util import timefuncs
 
 def execute(Macro, args):
     """ show SystemInfo: wiki infos, wiki sw version, space usage infos """
@@ -111,11 +112,15 @@
     row(_('Local extension parsers'),
         ', '.join(wikiutil.wikiPlugins('parser', Macro.cfg)) or nonestr)
 
-    state = (_('Disabled'), _('Enabled'))
+    from MoinMoin.search.builtin import Search
+    xapState = (_('Disabled'), _('Enabled'))
     idxState = (_('index available'), _('index unavailable'))
-    from MoinMoin.search.builtin import Search
-    row(_('Xapian search'), '%s, %s' % (state[request.cfg.xapian_search],
-                Search._xapianIndex(request) and idxState[0] or idxState[1]))
+    idx = Search._xapianIndex(request)
+    available = idx and idxState[0] or idxState[1]
+    mtime = _('last modified: %s') % (idx and
+            timefuncs.formathttpdate(idx.mtime()) or _('unavailable'))
+    row(_('Xapian search'), '%s, %s, %s'
+            % (xapState[request.cfg.xapian_search], available, mtime))
 
     row(_('Active threads'), t_count or 'N/A')
     buf.write(u'</dl>')
--- a/MoinMoin/search/Xapian.py	Mon Jul 24 11:52:07 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Mon Jul 24 14:18:55 2006 +0200
@@ -214,6 +214,7 @@
     
     def _do_queued_updates(self, request, amount=5):
         """ Assumes that the write lock is acquired """
+        self.touch()
         writer = xapidx.Index(self.dir, True)
         writer.configure(self.prefixMap, self.indexValueMap)
         pages = self.queue.pages()[:amount]
@@ -466,6 +467,7 @@
             mode = 'add'
 
         try:
+            self.touch()
             writer = xapidx.Index(self.dir, True)
             writer.configure(self.prefixMap, self.indexValueMap)
             pages = request.rootpage.getPageList(user='', exists=1)
--- a/MoinMoin/search/builtin.py	Mon Jul 24 11:52:07 2006 +0200
+++ b/MoinMoin/search/builtin.py	Mon Jul 24 14:18:55 2006 +0200
@@ -167,6 +167,9 @@
                 
     def mtime(self):
         return os.path.getmtime(self.dir)
+
+    def touch(self):
+        os.utime(self.dir)
     
     def _search(self, query):
         raise NotImplemented