[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex - PathIndex.py:1.6

Andreas Jung andreas@zope.com
Wed, 26 Sep 2001 10:55:52 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex
In directory cvs.zope.org:/tmp/cvs-serv14637

Modified Files:
	PathIndex.py 
Log Message:
added warning
fixed typo


=== Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 1.5 => 1.6 ===
 from BTrees.IIBTree import IISet,difference,intersection,union
 from types import StringType
-import re
+import re,warnings
 
 
 class PathIndex(PluggableIndex.PluggableIndex, Persistent,
@@ -345,6 +345,13 @@
         record = parseIndexRequest(request,self.id,self.query_options)
         if record.keys==None: return None
 
+        if request.has_key('%s_level' % cid):
+            warnings.warn("The usage of the '%s_level' "
+                          "is no longer recommended.\n"
+                          "Please use a mapping object and the "
+                          "'level' key to specify the operator." % cid)
+
+
         # get the level parameter 
         level    = record.get("level",0)
 
@@ -368,11 +375,10 @@
 
     
     def uniqueValues(self,name=None,withLength=0):
-        """ need to be consistent with the interface """
+        """ needed to be consistent with the interface """
 
         return self._index.keys()
         
-
 
     index_html = DTMLFile('dtml/index', globals())
     manage_workspace = DTMLFile('dtml/managePathIndex', globals())