[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.18

Andreas Jung andreas@zope.com
Thu, 11 Oct 2001 11:01:43 -0400


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

Modified Files:
	TextIndex.py 
Log Message:
TextIndex now takes care of unicode queries


=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.17 => 1.18 ===
             return ResultList(result, (word,), self)
         else:
+
             splitSource = tuple(self.getLexicon().Splitter(word))
 
             if not splitSource:
@@ -629,7 +630,8 @@
         operandType = type(left)
         if operandType is IntType:
             left = self[left]
-        elif operandType is StringType:
+        elif isinstance(operandType,StringType) or \
+             isinstance(operandType,UnicodeType):
             left = self[left]        
         elif operandType is ListType:
             left = self.evaluate(left)
@@ -637,7 +639,8 @@
         operandType = type(right)
         if operandType is IntType:
             right = self[right]
-        elif operandType is StringType:
+        elif isinstance(operandType,StringType) or \
+             isinstance(operandType,UnicodeType):
             right = self[right]       
         elif operandType is ListType:
             right = self.evaluate(right)