[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py Removed a warning at Zope startup.

Florent Guillaume fg at nuxeo.com
Thu Jun 1 07:50:03 EDT 2006


Log message for revision 68431:
  Removed a warning at Zope startup.

Changed:
  U   Zope/trunk/lib/python/Products/PluginIndexes/__init__.py

-=-
Modified: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/__init__.py	2006-06-01 11:48:09 UTC (rev 68430)
+++ Zope/trunk/lib/python/Products/PluginIndexes/__init__.py	2006-06-01 11:50:02 UTC (rev 68431)
@@ -16,13 +16,21 @@
 import common.UnIndex        as UnIndex
 
 import PathIndex.PathIndex
-import TextIndex.TextIndex
 import FieldIndex.FieldIndex
 import KeywordIndex.KeywordIndex
 import TopicIndex.TopicIndex
 import DateIndex.DateIndex
 import DateRangeIndex.DateRangeIndex
 
+# BBB: TextIndex is deprecated but we don't want the warning to appear here
+import warnings
+warnings.filterwarnings('ignore', message='^Using TextIndex', append=1)
+try:
+    import TextIndex.TextIndex
+finally:
+    del warnings.filters[-1]
+    del __warningregistry__
+
 _indexes =  ('TextIndex',
              'KeywordIndex',
              'FieldIndex',



More information about the Zope-Checkins mailing list