[Zope3-checkins] SVN: Zope3/branches/Zope-3.1/src/zope/component/bbb/ Rephrase deprecration warnings to point in the right direction.

Martijn Faassen faassen at infrae.com
Sat Sep 24 12:42:54 EDT 2005


Log message for revision 38596:
  Rephrase deprecration warnings to point in the right direction. 
  getDefaultViewName does exist and is even in zapi.
  
  Also add a note that IDefaultViewName is in fact not deprecated but
  in use, and need to move to become a (private?) interface in 
  zope.app.publisher, where getDefaultViewName is implemented.
  

Changed:
  U   Zope3/branches/Zope-3.1/src/zope/component/bbb/__init__.py
  U   Zope3/branches/Zope-3.1/src/zope/component/bbb/interfaces.py

-=-
Modified: Zope3/branches/Zope-3.1/src/zope/component/bbb/__init__.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/component/bbb/__init__.py	2005-09-24 16:17:10 UTC (rev 38595)
+++ Zope3/branches/Zope-3.1/src/zope/component/bbb/__init__.py	2005-09-24 16:42:54 UTC (rev 38596)
@@ -178,8 +178,7 @@
     if __warn__:
         warnings.warn(
             "The concrete concept of a view has been deprecated. You want to "
-            "use `getSiteManager(context).adapters.lookup(map(providedBy, "
-            "(object, request)), IDefaultViewName)",
+            "use `zapi.getDefaultViewName()` instead.",
             DeprecationWarning, warningLevel())
     view = queryDefaultViewName(object, request, context=context)
     if view is not None:
@@ -193,8 +192,7 @@
     if __warn__:
         warnings.warn(
             "The concrete concept of a view has been deprecated. You want to "
-            "use `getSiteManager(context).adapters.lookup(map(providedBy, "
-            "(object, request)), IDefaultViewName)`",
+            "use `zapi.queryDefaultViewName()` instead.",
             DeprecationWarning, warningLevel())
     from zope.component.bbb.exceptions import ComponentLookupError
     from zope.component import getSiteManager

Modified: Zope3/branches/Zope-3.1/src/zope/component/bbb/interfaces.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/component/bbb/interfaces.py	2005-09-24 16:17:10 UTC (rev 38595)
+++ Zope3/branches/Zope-3.1/src/zope/component/bbb/interfaces.py	2005-09-24 16:42:54 UTC (rev 38596)
@@ -331,7 +331,10 @@
         "stands in" for the user.
         """
 
-
+# When this code is removed, this needs to be undeprecated and moved
+# towards a private interface somewhere in zope.app.publisher. In
+# effect the Zope 3 core is still using IDefaultViewName at present,
+# even though it's in bbb.
 class IDefaultViewName(Interface):
     """A string that contains the default view name
 



More information about the Zope3-Checkins mailing list