[Zope-Checkins] SVN: Zope/trunk/ Removed fallback code for old `ZCatalog.catalog_object` function signatures from `Products.ZCatalog.ZCatalog.reindexIndex`.

Hanno Schlichting hannosch at hannosch.eu
Fri Jul 9 14:17:21 EDT 2010


Log message for revision 114396:
  Removed fallback code for old `ZCatalog.catalog_object` function signatures from `Products.ZCatalog.ZCatalog.reindexIndex`.
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/Products/ZCatalog/ZCatalog.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2010-07-09 18:12:20 UTC (rev 114395)
+++ Zope/trunk/doc/CHANGES.rst	2010-07-09 18:17:21 UTC (rev 114396)
@@ -19,6 +19,12 @@
   attribute in the browser:view directive. This attribute has never been
   supported in Zope 2.
 
+Restructuring
++++++++++++++
+
+- Removed fallback code for old `ZCatalog.catalog_object` function signatures
+  from `Products.ZCatalog.ZCatalog.reindexIndex`.
+
 Features Added
 ++++++++++++++
 

Modified: Zope/trunk/src/Products/ZCatalog/ZCatalog.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/ZCatalog.py	2010-07-09 18:12:20 UTC (rev 114395)
+++ Zope/trunk/src/Products/ZCatalog/ZCatalog.py	2010-07-09 18:17:21 UTC (rev 114396)
@@ -20,7 +20,6 @@
 import string
 import time
 import urllib
-from warnings import warn
 
 from AccessControl.class_init import InitializeClass
 from AccessControl.Permission import name_trans
@@ -466,26 +465,8 @@
             else:
                 # don't update metadata when only reindexing a single
                 # index via the UI
-                try:
-                    self.catalog_object(obj, p, idxs=name,
-                                        update_metadata=0, pghandler=pghandler)
-                except TypeError:
-                    # Fall back to Zope 2.6.2 interface. This is necessary for
-                    # products like CMF 1.4.2 and earlier that subclass from
-                    # ZCatalog and don't support the update_metadata argument.
-                    # May be removed some day.
-                    warn('catalog_object interface of %s not up to date'
-                         % self.__class__.__name__,
-                         DeprecationWarning)
-                    try:
-                        self.catalog_object(obj, p, idxs=name, pghandler=pghandler)
-                    except TypeError:
-                        # Fall back to pre-Zope 2.8 interface where there is no
-                        # 'pghandler' argument.
-                        warn('catalog_object interface of %s not up to date'
-                             % self.__class__.__name__,
-                             DeprecationWarning)
-                        self.catalog_object(obj, p, idxs=name)
+                self.catalog_object(obj, p, idxs=name,
+                                    update_metadata=0, pghandler=pghandler)
 
         if pghandler:
             pghandler.finish()



More information about the Zope-Checkins mailing list