[Zope-CVS] CVS: Products/FieldedTextIndex - index.py:1.6

Casey Duncan casey at zope.com
Sat Dec 13 23:18:14 EST 2003


Update of /cvs-repository/Products/FieldedTextIndex
In directory cvs.zope.org:/tmp/cvs-serv27316

Modified Files:
	index.py 
Log Message:
Add Zope 2.6 compatibility. UniqueValueIndex interface is not available in 2.6


=== Products/FieldedTextIndex/index.py 1.5 => 1.6 ===
--- Products/FieldedTextIndex/index.py:1.5	Fri Dec 12 00:09:26 2003
+++ Products/FieldedTextIndex/index.py	Sat Dec 13 23:18:13 2003
@@ -19,8 +19,6 @@
 import Acquisition
 from Persistence import Persistent
 from OFS.SimpleItem import SimpleItem
-from Products.PluginIndexes.common.PluggableIndex \
-    import UniqueValueIndex
 from Products.PluginIndexes.common.util import parseIndexRequest
 from AccessControl import Permissions
 from AccessControl.SecurityInfo import ClassSecurityInfo
@@ -33,7 +31,14 @@
 from BTrees.IOBTree import IOBTree
 from BTrees.IIBTree import IIBTree, IITreeSet, IIBucket
 from BTrees.IIBTree import weightedIntersection, multiunion, difference
-    
+
+try:
+    from Products.PluginIndexes.common.PluggableIndex \
+        import UniqueValueIndex
+except ImportError:
+    # Older Zope (pre 2.7) w/o UniqueValueIndex
+    from Products.PluginIndexes.common.PluggableIndex \
+        import PluggableIndexInterface as UniqueValueIndex
 
 class FieldedTextIndex(OkapiIndex, SimpleItem):
     """Multiple field text index"""




More information about the Zope-CVS mailing list