[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Some BBB code, so that my book sources are a little bit more happy.

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Aug 1 14:35:47 EDT 2005


Log message for revision 37627:
  Some BBB code, so that my book sources are a little bit more happy.
  

Changed:
  U   Zope3/trunk/src/zope/app/container/browser/metaconfigure.py
  U   Zope3/trunk/src/zope/app/file/interfaces.py
  U   Zope3/trunk/src/zope/app/publisher/browser/viewmeta.py

-=-
Modified: Zope3/trunk/src/zope/app/container/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/metaconfigure.py	2005-08-01 18:01:18 UTC (rev 37626)
+++ Zope3/trunk/src/zope/app/container/browser/metaconfigure.py	2005-08-01 18:35:47 UTC (rev 37627)
@@ -20,7 +20,7 @@
 
 from zope.app.component.fields import LayerField
 from zope.interface import Interface
-from zope.configuration.fields import GlobalInterface
+from zope.configuration.fields import GlobalObject
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 from zope.schema import Id
 from zope.app.publisher.browser.viewmeta import page, view
@@ -33,11 +33,11 @@
 class IContainerViews(Interface):
     """Define several container views for an `IContainer` implementation."""
 
-    for_ = GlobalInterface(
-        title=u"The interface this containerViews are for.",
+    for_ = GlobalObject(
+        title=u"The declaration this containerViews are for.",
         description=u"""
         The containerViews will be available for all objects that
-        implement this interface.
+        provide this declaration.
         """,
         required=True)
 

Modified: Zope3/trunk/src/zope/app/file/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/file/interfaces.py	2005-08-01 18:01:18 UTC (rev 37626)
+++ Zope3/trunk/src/zope/app/file/interfaces.py	2005-08-01 18:35:47 UTC (rev 37627)
@@ -21,6 +21,15 @@
 from zope.interface import Interface
 from zope.app.i18n import ZopeMessageIDFactory as _
 
+
+# BBB: To go away in 3.3
+from zope.app.publication.interfaces import IFileContent
+from zope.deprecation import deprecated
+deprecated('IFileContent',
+           '`IFileContent` has moved `zope.app.publication.interfaces`. '
+           'This will go away in 3.3.')
+
+
 class IFile(Interface):
 
     contentType = BytesLine(

Modified: Zope3/trunk/src/zope/app/publisher/browser/viewmeta.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/viewmeta.py	2005-08-01 18:01:18 UTC (rev 37626)
+++ Zope3/trunk/src/zope/app/publisher/browser/viewmeta.py	2005-08-01 18:35:47 UTC (rev 37627)
@@ -94,6 +94,18 @@
          attribute='__call__', menu=None, title=None, 
          ):
 
+    # BBB: Goes away in 3.3.
+    # Handle old default layer code. Code that reused the page directive will
+    # send a string.
+    if layer == 'default':
+        import warnings
+        warnings.warn(
+            'Strings as layer names are not supported anymore. In the case '
+            'of the `default` layer, please use the `IDefaultBrowserLayer` '
+            'instead. This support goes away in Zope 3.3.',
+            DeprecationWarning, 2)
+        layer = IDefaultBrowserLayer
+
     _handle_menu(_context, menu, title, [for_], name, permission, layer)
     required = {}
 



More information about the Zope3-Checkins mailing list