changeset 1477:7f5a6374e0e1

finish code docs for MoinMoin.search.Xapian
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Thu, 24 Aug 2006 13:46:12 +0200
parents 25ba2875b406
children 53e9c1db5ace
files MoinMoin/search/Xapian.py
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py	Thu Aug 24 13:38:38 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Thu Aug 24 13:46:12 2006 +0200
@@ -344,11 +344,17 @@
             pass
 
     def _get_languages(self, page):
+        """ Get language of a page and the language to stem it in
+
+        @param page: the page instance
+        """
         body = page.get_raw_body()
         default_lang = page.request.cfg.language_default
 
         lang = ''
 
+        # if we should stem, we check if we have stemmer for the
+        # language available
         if page.request.cfg.xapian_stemming:
             for line in body.split('\n'):
                 if line.startswith('#language'):
@@ -372,6 +378,11 @@
         return (lang, default_lang)
 
     def _get_categories(self, page):
+        """ Get all categories the page belongs to through the old
+            regular expression
+
+        @param page: the page instance
+        """
         body = page.get_raw_body()
 
         prev, next = (0, 1)
@@ -388,6 +399,10 @@
                 for cat in re.findall(r'Category([^\s]+)', body[pos:])]
 
     def _get_domains(self, page):
+        """ Returns a generator with all the domains the page belongs to
+
+        @param page: page
+        """
         if page.isUnderlayPage():
             yield 'underlay'
         if page.isStandardPage():
@@ -536,6 +551,11 @@
 
         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
+        @keyword files: an optional list of files to index
+        @keyword mode: how to index the files, either 'add', 'update' or
+                       'rebuild'
         """
 
         # rebuilding the DB: delete it and add everything