changeset 1497:ed3845759431

update comments/docstrings
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sat, 26 Aug 2006 18:21:54 +0200
parents 70e94a679c47
children 2807382fec1f
files MoinMoin/search/Xapian.py MoinMoin/search/builtin.py MoinMoin/search/queryparser.py MoinMoin/search/results.py
diffstat 4 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py	Sat Aug 26 17:37:17 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Sat Aug 26 18:21:54 2006 +0200
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - xapian indexing search engine
+    MoinMoin - xapian search engine
 
     @copyright: 2006 MoinMoin:ThomasWaldmann,
                 2006 MoinMoin:FranzPletz
@@ -57,7 +57,13 @@
     return (lambda: WikiAnalyzer(request, language))
 
 class WikiAnalyzer:
-    # TODO docstring
+    """ A text analyzer for wiki syntax
+    
+    The purpose of this class is to anaylze texts/pages in wiki syntax
+    and yield yielding single terms for xapwrap to feed into the xapian
+    database.
+    """
+
     singleword = r"[%(u)s][%(l)s]+" % {
                      'u': config.chars_upper,
                      'l': config.chars_lower,
@@ -231,7 +237,7 @@
         return BaseIndex.exists(self) and os.listdir(self.dir)
 
     def _search(self, query, sort=None, historysearch=0):
-        ### XXX docstring
+        """ Perform the search using xapian (read-lock acquired) """
         while True:
             try:
                 searcher, timestamp = self.request.cfg.xapian_searchers.pop()
--- a/MoinMoin/search/builtin.py	Sat Aug 26 17:37:17 2006 +0200
+++ b/MoinMoin/search/builtin.py	Sat Aug 26 18:21:54 2006 +0200
@@ -1,7 +1,6 @@
 # -*- coding: iso-8859-1 -*-
-# XXX docstring incorrect
 """
-    MoinMoin - search engine
+    MoinMoin - search engine internals
     
     @copyright: 2005 MoinMoin:FlorianFesti,
                 2005 MoinMoin:NirSoffer,
@@ -23,7 +22,8 @@
 ##############################################################################
 
 class UpdateQueue:
-    # XXX docstring
+    """ Represents a locked Page queue on the disk """
+
     def __init__(self, file, lock_dir):
         self.file = file
         self.writeLock = lock.WriteLock(lock_dir, timeout=10.0)
@@ -183,7 +183,7 @@
         os.utime(self.dir, None)
 
     def _search(self, query):
-        # XXX docstring
+        """ Actually perfom the search (read-lock acquired) """
         raise NotImplemented('...')
 
     def search(self, query, **kw):
@@ -331,7 +331,7 @@
             raise
 
     def _do_queued_updates(self, request, amount=5):
-        # XXX docstring
+        """ Perform updates in the queues (read-lock acquired) """
         raise NotImplemented('...')
 
     def optimize(self):
@@ -425,7 +425,7 @@
             hits = self._filter(hits)
 
         # when xapian was used, we can estimate the numer of matches
-        # XXX: hits can't be estimated by xapian with historysearch enabled
+        # Note: hits can't be estimated by xapian with historysearch enabled
         if not self.request.cfg.xapian_index_history and \
                 self.request.cfg.xapian_search:
             self.sort = None
--- a/MoinMoin/search/queryparser.py	Sat Aug 26 17:37:17 2006 +0200
+++ b/MoinMoin/search/queryparser.py	Sat Aug 26 18:21:54 2006 +0200
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - search engine query parser
+    MoinMoin - search query parser
     
     @copyright: 2005 MoinMoin:FlorianFesti,
                 2005 MoinMoin:NirSoffer,
@@ -57,7 +57,6 @@
         This Base class returns True (Match()) if not negated.
         """
         if self.negated:
-            # XXX why?
             return [Match()]
         else:
             return None
@@ -523,7 +522,6 @@
     def search(self, page):
         # Get matches in page name
         matches = []
-
         Found = True
 
         for link in page.getPageLinks(page.request):
@@ -538,7 +536,7 @@
             results = self.textsearch.search(page)
             if results:
                 matches.extend(results)
-            else: #This happens e.g. for pages that use navigation macros
+            else: # This happens e.g. for pages that use navigation macros
                 matches.append(TextMatch(0, 0))
 
         # Decide what to do with the results.
--- a/MoinMoin/search/results.py	Sat Aug 26 17:37:17 2006 +0200
+++ b/MoinMoin/search/results.py	Sat Aug 26 18:21:54 2006 +0200
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - search engine
+    MoinMoin - search results processing
     
     @copyright: 2005 MoinMoin:FlorianFesti,
                 2005 MoinMoin:NirSoffer,