changeset 5278:66f7fd87b2ae

xapian search: improve docstrings
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 14 Nov 2009 13:57:18 +0100
parents 110efceb9e28
children 2aa43685e17b
files MoinMoin/search/Xapian/indexing.py MoinMoin/search/builtin.py
diffstat 2 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian/indexing.py	Sat Nov 14 13:33:45 2009 +0100
+++ b/MoinMoin/search/Xapian/indexing.py	Sat Nov 14 13:57:18 2009 +0100
@@ -165,7 +165,7 @@
         return hits
 
     def _do_queued_updates(self, request, amount=5):
-        """ Assumes that the write lock is acquired """
+        """ Index <amount> entries from the indexer queue. """
         self.touch()
         connection = MoinIndexerConnection(self.dir)
         try:
@@ -288,7 +288,7 @@
             yield 'system'
 
     def _index_page(self, request, connection, pagename, mode='update'):
-        """ Index a page - assumes that the write lock is acquired
+        """ Index a page.
 
         Index all revisions (if wanted by configuration) and all attachments.
 
@@ -341,7 +341,7 @@
                 self._index_attachment(request, connection, pagename, attachmentname, mode)
 
     def _index_page_rev(self, request, connection, pagename, revno, mode='update'):
-        """ Index a page revision - assumes that the write lock is acquired
+        """ Index a page revision.
 
         @arg connection: the Indexer connection object
         @arg pagename: the page name
@@ -391,7 +391,7 @@
         return bool(doc)
 
     def _remove_page_rev(self, request, connection, pagename, revno):
-        """ Remove a page revision from the index - assumes that the write lock is acquired
+        """ Remove a page revision from the index.
 
         @arg connection: the Indexer connection object
         @arg pagename: the page name
@@ -447,9 +447,7 @@
             logging.debug('attachment %s (page %s) removed from index' % (attachmentname, pagename))
 
     def _index_file(self, request, connection, filename, mode='update'):
-        """ index a file as it were a page named pagename
-            Assumes that the write lock is acquired
-        """
+        """ index files (that are NOT attachments, just arbitrary files) """
         wikiname = request.cfg.interwikiname or u"Self"
         fs_rootpage = 'FS' # XXX FS hardcoded
 
@@ -487,9 +485,6 @@
 
         This should be called from indexPages or indexPagesInNewThread only!
 
-        When called in a new thread, lock is acquired before the call,
-        and this method must release it when it finishes or fails.
-
         @param request: the current request
         @param files: an optional list of files to index
         @param mode: how to index the files, either 'add', 'update' or 'rebuild'
--- a/MoinMoin/search/builtin.py	Sat Nov 14 13:33:45 2009 +0100
+++ b/MoinMoin/search/builtin.py	Sat Nov 14 13:57:18 2009 +0100
@@ -207,9 +207,6 @@
 
         This should be called from indexPages or indexPagesInNewThread only!
 
-        When called in a new thread, lock is acquired before the call,
-        and this method must release it when it finishes or fails.
-
         @param request: current request
         @param files: iterator or list of files to index additionally
         @param mode: set the mode of indexing the pages, either 'update',