diff roundup/backends/indexer_common.py @ 4089:eddb82d0964c

Add compatibility package to allow us to deal with Python versions 2.3..2.6. Outstanding issues noted in roundup/anypy/TODO.txt
author Richard Jones <richard@users.sourceforge.net>
date Thu, 12 Mar 2009 02:52:56 +0000
parents 605f4a7910b4
children 2ff6f39aa391
line wrap: on
line diff
--- a/roundup/backends/indexer_common.py	Thu Mar 12 02:25:03 2009 +0000
+++ b/roundup/backends/indexer_common.py	Thu Mar 12 02:52:56 2009 +0000
@@ -1,5 +1,7 @@
 #$Id: indexer_common.py,v 1.11 2008-09-11 19:41:07 schlatterbeck Exp $
-import re, sets
+import re
+# Python 2.3 ... 2.6 compatibility:
+from roundup.anypy.sets_ import set
 
 from roundup import hyperdb
 
@@ -17,7 +19,7 @@
 
 class Indexer:
     def __init__(self, db):
-        self.stopwords = sets.Set(STOPWORDS)
+        self.stopwords = set(STOPWORDS)
         for word in db.config[('main', 'indexer_stopwords')]:
             self.stopwords.add(word)
 
@@ -28,11 +30,11 @@
         return self.find(search_terms)
 
     def search(self, search_terms, klass, ignore={}):
-        '''Display search results looking for [search, terms] associated
+        """Display search results looking for [search, terms] associated
         with the hyperdb Class "klass". Ignore hits on {class: property}.
 
         "dre" is a helper, not an argument.
-        '''
+        """
         # do the index lookup
         hits = self.getHits(search_terms, klass)
         if not hits:

Roundup Issue Tracker: http://roundup-tracker.org/