[Zope-Checkins] CVS: Zope2 - UnTextIndex.py:1.39

Jim Fulton jim@digicool.com
Sat, 17 Mar 2001 11:11:40 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/SearchIndex
In directory korak:/tmp/cvs-serv18041

Modified Files:
	UnTextIndex.py 
Log Message:
Added (back) some weird logic that seems to be necessary to support
some old broken lexicon settings.



--- Updated File UnTextIndex.py in package Zope2 --
--- UnTextIndex.py	2001/03/15 13:16:24	1.38
+++ UnTextIndex.py	2001/03/17 16:11:39	1.39
@@ -179,7 +179,12 @@
         in this way, but I don't see too much of a problem with it."""
 
         if type(vocab_id) is not StringType:
-            return vocab_id
+            vocab = vocab_id # we already havd the lexicon
+
+            # Through some sick hysterical accident, some lexicons
+            # simply wrap other lexicons, unless they don't. Waaaaaa.
+            vocab = getattr(vocab, 'lexicon', vocab)
+            return vocab
         else:
             vocab = getattr(self, vocab_id)
             return vocab.lexicon