[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cvs
Subject:    [Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/KeywordIndex - KeywordIndex.py:1.14
From:       Casey Duncan <casey () zope ! com>
Date:       2003-02-28 15:52:04
[Download RAW message or body]

Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/KeywordIndex
In directory cvs.zope.org:/tmp/cvs-serv23228

Modified Files:
	KeywordIndex.py 
Log Message:
Merge keyindex unique value fix (issue #828)


=== Zope/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py 1.13 => 1.14 ===
--- Zope/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py:1.13	Thu Jan 23 12:46:23 2003
+++ Zope/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py	Fri Feb 28 10:51:33 2003
@@ -90,7 +90,13 @@
         if callable(newKeywords):
             newKeywords = newKeywords()
         if hasattr(newKeywords,'capitalize'): # is it string-like ?
-            newKeywords = (newKeywords, )
+            newKeywords = [newKeywords]
+        else:
+            # Uniqueify keywords
+            unique = {}
+            for k in newKeywords:
+                unique[k] = None
+            newKeywords = unique.keys()
         return newKeywords
 
     def unindex_objectKeywords(self, documentId, keywords):


_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic