[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog - ZCatalog.py:1.92.2.2
Andreas Jung
andreas@zope.com
Wed, 8 Aug 2001 11:31:59 -0400
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog
In directory cvs.zope.org:/tmp/cvs-serv21656
Modified Files:
Tag: Zope-2_4-branch
ZCatalog.py
Log Message:
"extra" parameter of addIndex() has not been passed to the
TextIndex constructor
=== Zope/lib/python/Products/ZCatalog/ZCatalog.py 1.92.2.1 => 1.92.2.2 ===
def addIndex(self, name, type,extra=None):
+
# Convert the type by finding an appropriate product which supports
# this interface by that name. Bleah
@@ -823,7 +824,16 @@
if base is None:
raise ValueError, "Index type %s does not support addIndex" % type
- index = base(name, self)
+ # This code is somewhat lame but every index type has its own function
+ # signature *sigh* and there is no common way to pass additional parameters
+ # to the constructor. The suggested way for new index types is to use
+ # an "extra" record.
+
+ if 'extra' in base.__init__.func_code.co_varnames:
+ index = apply(base,(name,), {"extra":extra})
+ else:
+ index = base(name,self)
+
self._catalog.addIndex(name,index)