[CMF-checkins] CVS: Products/CMFCore - CatalogTool.py:1.25

Casey Duncan casey@zope.com
Fri, 14 Jun 2002 09:56:55 -0400


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4617

Modified Files:
	CatalogTool.py 
Log Message:
Now creates a Vocabulary for itself if ZCatalog doesn't


=== Products/CMFCore/CatalogTool.py 1.24 => 1.25 ===
     def __init__(self):
         ZCatalog.__init__(self, self.getId())
+        
+        if not hasattr(self, 'Vocabulary'):
+            # As of 2.6, the Catalog no longer adds a vocabulary in itself
+            from Products.PluginIndexes.TextIndex.Vocabulary import Vocabulary
+            vocabulary = Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
+            self._setObject('Vocabulary', vocabulary)
+            
         self._initIndexes()
 
     #