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

Jim Fulton jim@digicool.com
Sat, 17 Mar 2001 13:15:26 -0500 (EST)


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

Modified Files:
      Tag: zope-2_3-branch
	Catalog.py 
Log Message:
An argument named 'type' shadowed the builtin. Waaaa.



--- Updated File Catalog.py in package Zope2 --
--- Catalog.py	2001/03/17 18:01:16	1.60.2.6
+++ Catalog.py	2001/03/17 18:15:25	1.60.2.7
@@ -334,8 +334,8 @@
             rec.remove(rec[_index])
             self.data[key] = tuple(rec)
 
-    def addIndex(self, name, type):
-        """Create a new index, of one of the following types
+    def addIndex(self, name, index_type):
+        """Create a new index, of one of the following index_types
 
         Types: 'FieldIndex', 'TextIndex', 'KeywordIndex'.
         """
@@ -350,18 +350,19 @@
         # pluggable and managable
 
         indexes = self.indexes
-        if type == 'FieldIndex':
+        if index_type == 'FieldIndex':
             indexes[name] = UnIndex.UnIndex(name)
-        elif type == 'TextIndex':
+        elif index_type == 'TextIndex':
             lexicon=self.lexicon
             if type(lexicon) is type(''): lexicon=getattr(self, lexicon)
             indexes[name] = UnTextIndex.UnTextIndex(name, None, None, lexicon)
-        elif type == 'KeywordIndex':
+        elif index_type == 'KeywordIndex':
             indexes[name] = UnKeywordIndex.UnKeywordIndex(name)
         else:
-            raise 'Unknown Index Type', ("%s invalid - must be one of %s"
-                                         % (type, ['FieldIndex', 'TextIndex',
-                                                   'KeywordIndex']))
+            raise 'Unknown Index Type', (
+                "%s invalid - must be one of %s"
+                % (index_type, ['FieldIndex', 'TextIndex', 'KeywordIndex'])
+                )
 
         self.indexes = indexes