[Zope-Checkins] SVN: Zope/trunk/ Fully deprecate both CatalogAwareness and CatalogPathAwareness. They are untested and unused. Event subscribers for zope.lifecycleevents are the way to go.

Hanno Schlichting hannosch at hannosch.eu
Sun Aug 1 06:22:07 EDT 2010


Log message for revision 115308:
  Fully deprecate both CatalogAwareness and CatalogPathAwareness. They are untested and unused. Event subscribers for zope.lifecycleevents are the way to go.
  

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

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2010-08-01 10:15:38 UTC (rev 115307)
+++ Zope/trunk/doc/CHANGES.rst	2010-08-01 10:22:07 UTC (rev 115308)
@@ -35,8 +35,8 @@
 Restructuring
 +++++++++++++
 
-- Emit a deprecation warning for ``Products.ZCatalog.CatalogAwareness``. The
-  module was already deprecated according to its docstring.
+- Deprecated the ``Products.ZCatalog.CatalogAwareness`` and
+  ``CatalogPathAwareness`` modules.
 
 - Removed deprecated ``catalog-getObject-raises`` zope.conf option.
 

Modified: Zope/trunk/src/Products/ZCatalog/CatalogAwareness.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/CatalogAwareness.py	2010-08-01 10:15:38 UTC (rev 115307)
+++ Zope/trunk/src/Products/ZCatalog/CatalogAwareness.py	2010-08-01 10:22:07 UTC (rev 115308)
@@ -39,7 +39,8 @@
     def _warn_deprecated(self):
         warnings.warn('The Products.ZCatalog.CatalogAwareness module is '
                       'deprecated and will be removed in Zope 2.14. Please '
-                      'use the CatalogPathAwareness module instead.',
+                      'use event subscribers for zope.lifecycle events to '
+                      'automatically index and unindex your objects.',
                       DeprecationWarning, stacklevel=3)
 
     def manage_editCataloger(self, default, REQUEST=None):

Modified: Zope/trunk/src/Products/ZCatalog/CatalogPathAwareness.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/CatalogPathAwareness.py	2010-08-01 10:15:38 UTC (rev 115307)
+++ Zope/trunk/src/Products/ZCatalog/CatalogPathAwareness.py	2010-08-01 10:22:07 UTC (rev 115308)
@@ -13,6 +13,8 @@
 """ZCatalog Findable class
 """
 
+import warnings
+
 from Acquisition import aq_base
 from App.special_dtml import DTMLFile
 
@@ -30,6 +32,13 @@
 
     manage_editCatalogerForm=DTMLFile('dtml/editCatalogerForm', globals())
 
+    def _warn_deprecated(self):
+        warnings.warn('The Products.ZCatalog.CatalogPathAwareness module is '
+                      'deprecated and will be removed in Zope 2.14. Please '
+                      'use event subscribers for zope.lifecycle events to '
+                      'automatically index and unindex your objects.',
+                      DeprecationWarning, stacklevel=3)
+
     def manage_editCataloger(self, default, REQUEST=None):
         """ """
         self.default_catalog=default
@@ -37,7 +46,6 @@
         if REQUEST is not None:
             return self.manage_main(self, REQUEST, manage_tabs_message=message)
 
-
     def manage_afterAdd(self, item, container):
         self.index_object()
         for object in self.objectValues():
@@ -100,12 +108,14 @@
 
     def index_object(self):
         """A common method to allow Findables to index themselves."""
+        self._warn_deprecated()
         if hasattr(self, self.default_catalog):
             getattr(self,
                     self.default_catalog).catalog_object(self, self.getPath())
 
     def unindex_object(self):
         """A common method to allow Findables to unindex themselves."""
+        self._warn_deprecated()
         if hasattr(self, self.default_catalog):
             getattr(self,
                     self.default_catalog).uncatalog_object(self.getPath())



More information about the Zope-Checkins mailing list