[Zope-Checkins] CVS: Zope2 - Catalog.py:1.60.2.5

Jim Fulton jim@digicool.com
Sat, 17 Mar 2001 12:28:07 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/Products/ZCatalog
In directory korak:/tmp/cvs-serv22519

Modified Files:
      Tag: zope-2_3-branch
	Catalog.py 
Log Message:
When converting BTrees, convert indexes in context. This is necessary
to help UnTextIndexes get their (previously) acquired lexicons.

UnTextIndexes now refer directly to their lexicons.



--- Updated File Catalog.py in package Zope2 --
--- Catalog.py	2001/03/16 18:22:43	1.60.2.4
+++ Catalog.py	2001/03/17 17:28:07	1.60.2.5
@@ -200,6 +200,7 @@
 
 
         for index in self.indexes.values():
+            if hasattr(index, '__of__'): index=index.__of__(self)
             index._convertBTrees(threshold)
 
         lexicon=self.lexicon
@@ -352,8 +353,10 @@
         if type == 'FieldIndex':
             indexes[name] = UnIndex.UnIndex(name)
         elif type == 'TextIndex':
-            indexes[name] = UnTextIndex.UnTextIndex(name, None, None,
-                                                    self.lexicon)
+            indexes[name] = UnTextIndex.UnTextIndex(
+                name, None, None,
+                getattr(self, self.lexicon), # The index needs to have the lex.
+                )
         elif type == 'KeywordIndex':
             indexes[name] = UnKeywordIndex.UnKeywordIndex(name)
         else: