[Zope3-checkins] SVN: Zope3/trunk/src/ Merge philikon-simplify-skinning branch. See http://dev.zope.org/Zope3/SimplifySkinning.

Philipp von Weitershausen philikon at philikon.de
Mon Feb 27 00:24:28 EST 2006


Log message for revision 65511:
  Merge philikon-simplify-skinning branch.  See http://dev.zope.org/Zope3/SimplifySkinning.
  
  Basically, browser:skin and browser:layer are deprecated now, as well as the ILayer
  interface type.
  

Changed:
  U   Zope3/trunk/src/bugtracker/browser/skin/__init__.py
  U   Zope3/trunk/src/bugtracker/browser/skin/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/browser/skin.py
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/presentation_macros.pt
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/tests.py
  U   Zope3/trunk/src/zope/app/apidoc/presentation.py
  U   Zope3/trunk/src/zope/app/apidoc/presentation.txt
  U   Zope3/trunk/src/zope/app/apidoc/tests.py
  UU  Zope3/trunk/src/zope/app/basicskin/__init__.py
  U   Zope3/trunk/src/zope/app/basicskin/configure.zcml
  U   Zope3/trunk/src/zope/app/boston/__init__.py
  U   Zope3/trunk/src/zope/app/boston/configure.zcml
  U   Zope3/trunk/src/zope/app/browser.zcml
  UU  Zope3/trunk/src/zope/app/component/fields.py
  U   Zope3/trunk/src/zope/app/component/metaconfigure.py
  U   Zope3/trunk/src/zope/app/component/metadirectives.py
  U   Zope3/trunk/src/zope/app/container/browser/tests/test_directive.py
  U   Zope3/trunk/src/zope/app/css/__init__.py
  U   Zope3/trunk/src/zope/app/css/configure.zcml
  UU  Zope3/trunk/src/zope/app/debugskin/__init__.py
  U   Zope3/trunk/src/zope/app/debugskin/configure.zcml
  U   Zope3/trunk/src/zope/app/demo/skinpref/configure.zcml
  U   Zope3/trunk/src/zope/app/demo/skinpref/interfaces.py
  U   Zope3/trunk/src/zope/app/demo/skinpref/skin.py
  A   Zope3/trunk/src/zope/app/layers.py
  U   Zope3/trunk/src/zope/app/publisher/browser/__init__.py
  U   Zope3/trunk/src/zope/app/publisher/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/publisher/browser/meta.zcml
  U   Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py
  U   Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py
  U   Zope3/trunk/src/zope/app/publisher/browser/tests/addmenuitems.zcml
  U   Zope3/trunk/src/zope/app/publisher/browser/tests/test_addMenuItem.py
  U   Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py
  UU  Zope3/trunk/src/zope/app/rotterdam/__init__.py
  U   Zope3/trunk/src/zope/app/rotterdam/configure.zcml
  A   Zope3/trunk/src/zope/app/skins.py
  U   Zope3/trunk/src/zope/app/traversing/namespace.py
  U   Zope3/trunk/src/zope/app/traversing/tests/test_skin.py
  U   Zope3/trunk/src/zope/app/tree/browser/__init__.py
  U   Zope3/trunk/src/zope/app/tree/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/zopetop/__init__.py
  U   Zope3/trunk/src/zope/app/zopetop/configure.zcml
  U   Zope3/trunk/src/zope/app/zopetop/ftests.py
  U   Zope3/trunk/src/zope/deprecation/README.txt
  U   Zope3/trunk/src/zope/deprecation/deprecation.py
  U   Zope3/trunk/src/zope/deprecation/tests.py
  U   Zope3/trunk/src/zope/publisher/interfaces/__init__.py
  U   Zope3/trunk/src/zope/publisher/interfaces/browser.py
  U   Zope3/trunk/src/zope/publisher/tests/basetestipublicationrequest.py
  U   Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py
  UU  Zope3/trunk/src/zwiki/browser/skin/__init__.py
  U   Zope3/trunk/src/zwiki/browser/skin/configure.zcml

-=-
Modified: Zope3/trunk/src/bugtracker/browser/skin/__init__.py
===================================================================
--- Zope3/trunk/src/bugtracker/browser/skin/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/bugtracker/browser/skin/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -0,0 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bug tracker skin
+
+$Id$
+"""
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import Rotterdam
+
+class IBugtrackerLayer(IBrowserRequest):
+    """Layer for registering bugtracker views"""
+
+class IBugtrackerSkin(IBugtrackerLayer, Rotterdam):
+    """The bugtracker skin"""
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('tracker', IBugtrackerSkin)

Modified: Zope3/trunk/src/bugtracker/browser/skin/configure.zcml
===================================================================
--- Zope3/trunk/src/bugtracker/browser/skin/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/bugtracker/browser/skin/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1,8 +1,20 @@
-<configure xmlns="http://namespaces.zope.org/browser">
+<configure
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:zope="http://namespaces.zope.org/zope"
+    >
 
-  <layer name="tracker" />
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
+  <layer
+      interface=".IBugtrackerLayer"
+      name="tracker"
+      bbb_aware="true"
+      />
 
-  <skin name="tracker" layers="tracker zope.app.rotterdam.rotterdam default" />
+  <zope:interface
+      interface=".IBugtrackerSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="tracker"
+      />
 
   <page 
       for="*"

Modified: Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1,14 +1,20 @@
 <configure
   xmlns="http://namespaces.zope.org/browser"
+  xmlns:zope="http://namespaces.zope.org/zope"
   i18n_domain="zope">
 
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
   <layer
       name="apidoc"
-      interface=".skin.apidoc" />
+      interface=".skin.apidoc"
+      bbb_aware="true"
+      />
 
-  <skin
+  <zope:interface
+      interface=".skin.APIDOC"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="APIDOC"
-      interface=".skin.APIDOC" />
+      />
 
   <resource
       name="apidoc.css"

Modified: Zope3/trunk/src/zope/app/apidoc/browser/skin.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/skin.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/browser/skin.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -26,3 +26,6 @@
 class APIDOC(apidoc, IDefaultBrowserLayer):
     """The `APIDOC` skin."""
 
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('APIDOC', APIDOC)

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -22,7 +22,6 @@
 from zope.interface import Interface
 
 from zope.publisher.interfaces import IRequest
-from zope.publisher.interfaces.browser import ILayer
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
 from zope.publisher.interfaces.http import IHTTPRequest

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/presentation_macros.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/presentation_macros.pt	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/presentation_macros.pt	2006-02-27 05:24:24 UTC (rev 65511)
@@ -21,10 +21,10 @@
       </a>
     </div>
 
-    <div tal:define="ifaces python:View['required'][:-1]">
+    <div tal:define="ifaces python:View['required']">
       <i i18n:translate="">requires:</i>
       <tal:block repeat="iface ifaces">
-        <a href=""
+        <tal:block condition="not:iface">*</tal:block><a href=""
             tal:condition="iface"
             tal:attributes="
        href string:$rootURL/Interface/${iface/module}.${iface/name}/index.html">
@@ -46,16 +46,6 @@
       </a>
     </div>
 
-    <div tal:define="iface View/layer"
-         tal:condition="iface">
-      <i i18n:translate="">layer:</i>
-      <a href=""
-         tal:attributes="
-      href string:$rootURL/Interface/${iface/module}.${iface/name}/index.html">
-        <metal:block use-macro="context/@@interface_macros/ifacename" />
-      </a>
-    </div>
-
     <div condition="View/factory/path">
       <i i18n:translate="">factory path:</i>
       <a href=""

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/tests.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/tests.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -57,4 +57,4 @@
         ))
 
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main(defaultTest="test_suite")

Modified: Zope3/trunk/src/zope/app/apidoc/presentation.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/presentation.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/presentation.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -26,7 +26,7 @@
 from zope.app.apidoc.component import getInterfaceInfoDictionary
 from zope.app.publisher.browser.icon import IconViewFactory
 
-from zope.publisher.interfaces import IRequest, ILayer
+from zope.publisher.interfaces import IRequest
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
 from zope.publisher.interfaces.http import IHTTPRequest
@@ -164,19 +164,12 @@
         doc = None
         zcml = getParserInfoInfoDictionary(reg.doc)
 
-    # get layer
-    layer = None
-    if ILayer.providedBy(reg.required[-1]):
-        layer = getInterfaceInfoDictionary(reg.required[-1])
-
-
     info = {'name' : reg.name or '<i>no name</i>',
             'type' : getPythonPath(getPresentationType(reg.required[-1])),
             'factory' : getViewFactoryData(reg.value),
             'required': [getInterfaceInfoDictionary(iface)
                          for iface in reg.required],
             'provided' : getInterfaceInfoDictionary(reg.provided),
-            'layer': layer,
             'doc': doc,
             'zcml': zcml
             }

Modified: Zope3/trunk/src/zope/app/apidoc/presentation.txt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/presentation.txt	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/presentation.txt	2006-02-27 05:24:24 UTC (rev 65511)
@@ -402,7 +402,6 @@
                'resource': None,
                'template': None,
                'url': '__builtin__/Factory'},
-   'layer': None,
    'name': 'view.html',
    'provided': {'module': 'zope.interface',
                 'name': 'Interface'},

Modified: Zope3/trunk/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/tests.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/apidoc/tests.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -97,4 +97,4 @@
         ))
 
 if __name__ == '__main__':
-    unittest.main(default="test_suite")
+    unittest.main(defaultTest="test_suite")

Modified: Zope3/trunk/src/zope/app/basicskin/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/basicskin/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/basicskin/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1,2 +1,27 @@
+##############################################################################
 #
-# This file is necessary to make this directory a package.
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Basic skin
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+
+class IBasicSkin(IDefaultBrowserLayer):
+    """Basic skin that simply only contains the default layer and
+    nothing else"""
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('Basic', IBasicSkin)


Property changes on: Zope3/trunk/src/zope/app/basicskin/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zope/app/basicskin/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/basicskin/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/basicskin/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -2,7 +2,11 @@
    xmlns:zope="http://namespaces.zope.org/zope"
    xmlns="http://namespaces.zope.org/browser">
 
-  <skin name="Basic" layers="default" />
+  <zope:interface
+      interface=".IBasicSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="Basic"
+      />
 
   <page
       name="standard_macros"

Modified: Zope3/trunk/src/zope/app/boston/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/boston/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/boston/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -33,6 +33,9 @@
     or via `++skin++Boston`.
     """
 
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('Boston', Boston)
 
 class IHead(IViewletManager):
     """Head viewlet manager."""

Modified: Zope3/trunk/src/zope/app/boston/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/boston/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/boston/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -5,14 +5,17 @@
     xmlns:zcml="http://namespaces.zope.org/zcml"
     i18n_domain="zope">
 
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
   <layer
       name="boston"
       interface="zope.app.boston.boston"
+      bbb_aware="true"
       />
 
-  <skin
+  <zope:interface
+      interface="zope.app.boston.Boston"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="Boston"
-      interface="zope.app.boston.Boston"
       />
 
   <viewletManager

Modified: Zope3/trunk/src/zope/app/browser.zcml
===================================================================
--- Zope3/trunk/src/zope/app/browser.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/browser.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -3,7 +3,7 @@
    xmlns:browser="http://namespaces.zope.org/browser">
 
   <browser:defaultView name="index.html" />
-  <browser:defaultSkin name="zope.app.rotterdam.Rotterdam" />
+  <browser:defaultSkin name="Rotterdam" />
 
   <include package="zope.app.exception.browser" />
   <include package="zope.app.traversing.browser" />

Modified: Zope3/trunk/src/zope/app/component/fields.py
===================================================================
--- Zope3/trunk/src/zope/app/component/fields.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/component/fields.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -21,10 +21,14 @@
 from zope.component.exceptions import ComponentLookupError
 from zope.configuration.exceptions import ConfigurationError
 from zope.configuration.fields import GlobalObject
-from zope.publisher.interfaces.browser import ILayer
 
 from zope.app import zapi
 
+# BBB 2006/02/18, to be removed after 12 months
+import zope.deprecation
+zope.deprecation.__show__.off()
+from zope.publisher.interfaces import ILayer
+zope.deprecation.__show__.on()
 
 class LayerField(GlobalObject):
     r"""This field represents a layer.


Property changes on: Zope3/trunk/src/zope/app/component/fields.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zope/app/component/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/component/metaconfigure.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/component/metaconfigure.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -17,13 +17,13 @@
 """
 __docformat__ = 'restructuredtext'
 
+import warnings
+import zope.interface
 from zope import component
 from zope.component.interfaces import IDefaultViewName, IFactory
 from zope.configuration.exceptions import ConfigurationError
-import zope.interface
 from zope.interface import Interface, providedBy
 from zope.interface.interfaces import IInterface
-
 from zope.proxy import ProxyBase, getProxiedObject
 
 from zope.security.checker import InterfaceChecker, CheckerPublic
@@ -42,11 +42,11 @@
     method(*args, **kwargs)
 
 from zope.app.component.interface import provideInterface
-def interface(_context, interface, type=None):
+def interface(_context, interface, type=None, name=''):
     _context.action(
         discriminator = None,
         callable = provideInterface,
-        args = ('', interface, type)
+        args = (name, interface, type)
         )
 
 
@@ -310,7 +310,6 @@
             )
 
     if permission:
-
         checker = _checker(_context, permission,
                            allowed_interface, allowed_attributes)
 
@@ -319,14 +318,18 @@
 
         factory = proxyResource
 
-    if layer is None:
-        layer = type
+    if layer is not None:
+        warnings.warn_explicit(
+            "The 'layer' argument of the 'resource' directive has been "
+            "deprecated.  Use the 'type' argument instead.",
+            DeprecationWarning, _context.info.file, _context.info.line)
+        type = layer
 
     _context.action(
-        discriminator = ('resource', name, layer, provides),
+        discriminator = ('resource', name, type, provides),
         callable = handler,
         args = ('provideAdapter',
-                (layer,), provides, name, factory, _context.info),
+                (type,), provides, name, factory, _context.info),
         )
     _context.action(
         discriminator = None,
@@ -389,9 +392,13 @@
                 ob = f(ob)
             return factories[-1](ob, request)
 
-    # if layer not specified, use default layer for type
+    # BBB 2006/02/18, to be removed after 12 months
     if layer is not None:
         for_ = for_ + (layer,)
+        warnings.warn_explicit(
+            "The 'layer' argument of the 'view' directive has been "
+            "deprecated.  Use the 'type' argument instead.",
+            DeprecationWarning, _context.info.file, _context.info.line)
     else:
         for_ = for_ + (type,)
 
@@ -453,6 +460,7 @@
            'Will be gone in Zope 3.3.')
 ############################################################################
 
+# BBB: Deprecated. Will go away in 3.4.
 def defaultLayer(_context, type, layer):
     import warnings
     warnings.warn("""The defaultLayer directive is deprecated and will

Modified: Zope3/trunk/src/zope/app/component/metadirectives.py
===================================================================
--- Zope3/trunk/src/zope/app/component/metadirectives.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/component/metadirectives.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -85,6 +85,7 @@
         required=False,
         )
 
+    # BBB 2006/02/18, to be removed after 12 months
     layer = zope.app.component.fields.LayerField(
         title=_("The layer the view is in."),
         description=_("""
@@ -161,6 +162,11 @@
         required=False,
         )
 
+    name = zope.schema.TextLine(
+        title=_("Name"),
+        required=False,
+        )
+
 class IAdapterDirective(zope.interface.Interface):
     """
     Register an adapter
@@ -374,8 +380,11 @@
                          IBasicResourceInformation):
     """Register a resource"""
 
+    # BBB 2006/02/18, to be removed after 12 months
     layer = zope.app.component.fields.LayerField(
-        title=_("The layer the resource is in."),
+        title=_("The layer the resource is in.  This argument has been "
+                "deprecated and will be removed in Zope 3.5.  Use the "
+                "'type' argument instead."),
         required=False,
         )
 
@@ -511,9 +520,12 @@
         required=False,
         )
 
+# BBB: Deprecated. Will go away in 3.4.
 class IDefaultLayerDirective(zope.interface.Interface):
-    """Associate a default layer with a request type."""
+    """Associate a default layer with a request type.
 
+    This directive has been deprecated and will go away in Zope 3.4."""
+
     type = zope.configuration.fields.GlobalInterface(
         title=_("Request type"),
         required=True

Modified: Zope3/trunk/src/zope/app/container/browser/tests/test_directive.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/tests/test_directive.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/container/browser/tests/test_directive.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -21,7 +21,7 @@
 
 import unittest
 from zope.interface import Interface
-from zope.publisher.interfaces import ILayer
+from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.testing.doctestunit import DocTestSuite
 from zope.app.container.browser.metaconfigure import containerViews
 
@@ -46,7 +46,7 @@
     pass
 
 
-class ITestLayer(ILayer):
+class ITestLayer(IBrowserRequest):
     pass
 
 

Modified: Zope3/trunk/src/zope/app/css/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/css/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/css/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -29,3 +29,7 @@
     It is available via `++skin++zope.app.css.CSS`
     or via `++skin++CSS`.
     """
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('CSS', CSS)

Modified: Zope3/trunk/src/zope/app/css/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/css/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/css/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -2,13 +2,18 @@
     xmlns="http://namespaces.zope.org/zope"
     xmlns:browser="http://namespaces.zope.org/browser">
 
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
   <browser:layer 
       name="css"
-      interface="zope.app.css.layer" />  
+      interface="zope.app.css.layer"
+      bbb_aware="true"
+      />
 
-  <browser:skin 
+  <interface
+      interface="zope.app.css.CSS"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="CSS"
-      interface="zope.app.css.CSS" />
+      />
   
   <browser:resource 
       name="zope3.css" 

Modified: Zope3/trunk/src/zope/app/debugskin/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/debugskin/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1 +1,30 @@
-# Make this directory a package.
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Debug skin
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import Rotterdam
+
+class IDebugLayer(IBrowserRequest):
+    """Layer that we can register debug views with."""
+
+class IDebugSkin(IDebugLayer, Rotterdam):
+    """Rotterdam-based skin with debug functionality"""
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('Debug', IDebugSkin)


Property changes on: Zope3/trunk/src/zope/app/debugskin/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zope/app/debugskin/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/debugskin/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1,17 +1,28 @@
-<configure xmlns="http://namespaces.zope.org/browser">
+<configure
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:zope="http://namespaces.zope.org/zope"
+    >
 
-  <layer name="debug" />
-  <skin 
-      name="Debug" 
-      layers="debug zope.app.rotterdam.rotterdam default" />
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
+  <layer
+      interface=".IDebugLayer"
+      name="debug"
+      bbb_aware="true"
+      />
 
+  <zope:interface
+      interface=".IDebugSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="Debug"
+      />
+
   <page
       for="zope.security.interfaces.IUnauthorized"
       name="index.html"
       permission="zope.Public"
       template="unauthorized.pt"
       class="zope.app.exception.browser.unauthorized.Unauthorized"
-      layer="debug" 
+      layer=".IDebugLayer"
       />
 
   <page 
@@ -20,7 +31,7 @@
       for="zope.interface.common.interfaces.IException"
       class=".exceptions.ExceptionDebugView"
       permission="zope.Public"
-      layer="debug" 
+      layer=".IDebugLayer"
       />
 
   <!-- Need to repeat for NotFound to override default view -->
@@ -33,8 +44,7 @@
       for="zope.publisher.interfaces.INotFound"
       class=".exceptions.ExceptionDebugView"
       permission="zope.Public"
-      layer="debug" 
+      layer=".IDebugLayer"
       />
 
-
 </configure>

Modified: Zope3/trunk/src/zope/app/demo/skinpref/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/demo/skinpref/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/demo/skinpref/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -7,11 +7,6 @@
       handler=".skin.applySkin"
       />
 
-  <vocabulary
-      name="Skins"
-      factory="zope.app.component.vocabulary.UtilityVocabulary"
-      interface="zope.publisher.interfaces.browser.ISkin" />
-
   <preferenceGroup
       id="zmi"
       title="ZMI Settings"

Modified: Zope3/trunk/src/zope/app/demo/skinpref/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/skinpref/interfaces.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/demo/skinpref/interfaces.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -31,6 +31,6 @@
             Note: You have to reload the page again for the setting to show an
             effect.
             """,
-        vocabulary="Skins",
+        vocabulary="Browser Skins",
         default=None,
         required=False)

Modified: Zope3/trunk/src/zope/app/demo/skinpref/skin.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/skinpref/skin.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/demo/skinpref/skin.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -18,7 +18,7 @@
 __docformat__ = "reStructuredText"
 
 import zope.interface
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.app.component.interfaces import ISite
 from zope.app.preference.interfaces import IUserPreferences
 from zope.app.publisher.browser import applySkin as applySkinOnRequest

Copied: Zope3/trunk/src/zope/app/layers.py (from rev 65508, Zope3/branches/philikon-simplify-skinning/src/zope/app/layers.py)

Modified: Zope3/trunk/src/zope/app/publisher/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -26,7 +26,7 @@
 
 from zope.app.location import Location
 from zope.app.publisher.interfaces.browser import IBrowserView
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 
 
 key = "zope.app.publisher.browser.IUserPreferredLanguages"
@@ -107,9 +107,9 @@
     >>> import pprint
     >>> from zope.interface import Interface, providedBy
     >>> class SkinA(Interface): pass
-    >>> directlyProvides(SkinA, ISkin)
+    >>> directlyProvides(SkinA, IBrowserSkinType)
     >>> class SkinB(Interface): pass
-    >>> directlyProvides(SkinB, ISkin)
+    >>> directlyProvides(SkinB, IBrowserSkinType)
     >>> class IRequest(Interface): pass
 
     >>> class Request(object):
@@ -130,7 +130,7 @@
     # Remove all existing skin declarations (commonly the default skin).
     ifaces = [iface
               for iface in directlyProvidedBy(request)
-              if not ISkin.providedBy(iface)]
+              if not IBrowserSkinType.providedBy(iface)]
     # Add the new skin.
     ifaces.append(skin)
     directlyProvides(request, *ifaces)

Modified: Zope3/trunk/src/zope/app/publisher/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -3,16 +3,23 @@
    xmlns:browser="http://namespaces.zope.org/browser">
 
 <interface
-  interface="zope.publisher.interfaces.browser.ILayer" />
+  interface="zope.app.publisher.interfaces.browser.IMenuItemType" />
 
 <interface
-  interface="zope.publisher.interfaces.browser.ISkin" />
+  interface="zope.publisher.interfaces.browser.IBrowserSkinType" />
 
-<interface
-  interface="zope.app.publisher.interfaces.browser.IMenuItemType" />
+<vocabulary
+    name="Browser Skins"
+    factory="zope.app.component.vocabulary.UtilityVocabulary"
+    interface="zope.publisher.interfaces.browser.IBrowserSkinType"
+    />
 
-<browser:layer name="default"
-  interface="zope.publisher.interfaces.browser.IDefaultBrowserLayer" />
+<!-- BBB 2006/02/18, to be removed after 12 months -->
+<browser:layer
+    name="default"
+    interface="zope.publisher.interfaces.browser.IDefaultBrowserLayer"
+    bbb_aware="true"
+    />
 
 <content class="zope.publisher.browser.BrowserRequest">
   <allow

Modified: Zope3/trunk/src/zope/app/publisher/browser/meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/meta.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/meta.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -145,12 +145,14 @@
 
     <!-- misc. directives -->
 
+    <!-- BBB 2006/02/18, to be removed after 12 months -->
     <meta:directive
         name="layer"
         schema=".metadirectives.ILayerDirective"
         handler=".metaconfigure.layer"
         />
 
+    <!-- BBB 2006/02/18, to be removed after 12 months -->
     <meta:directive
         name="skin"
         schema=".metadirectives.ISkinDirective"

Modified: Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -15,14 +15,15 @@
 
 $Id$
 """
+import warnings
 from zope.component.interfaces import IDefaultViewName
 from zope.configuration.exceptions import ConfigurationError
 from zope.interface import directlyProvides
 from zope.interface.interface import InterfaceClass
-from zope.publisher.interfaces.browser import ILayer, ISkin, IDefaultSkin
-from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.interfaces.browser import IBrowserRequest, IDefaultSkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 
-from zope.app import zapi
+from zope.app import zapi, layers, skins
 from zope.app.component.metaconfigure import handler
 
 # referred to through ZCML
@@ -32,28 +33,32 @@
 from zope.app.publisher.browser.viewmeta import view
 from zope.app.component.interface import provideInterface
 
-# Create special modules that contain all layers and skins
-from types import ModuleType as module
-import sys
-import zope.app
-zope.app.layers = module('layers')
-sys.modules['zope.app.layers'] = zope.app.layers
+# BBB 2006/02/18, to be removed after 12 months
+import zope.deprecation
+zope.deprecation.__show__.off()
+from zope.publisher.interfaces.browser import ILayer
+zope.deprecation.__show__.on()
 
-zope.app.skins = module('skins')
-sys.modules['zope.app.skins'] = zope.app.skins
+# BBB 2006/02/18, to be removed after 12 months
+def layer(_context, name=None, interface=None, base=IBrowserRequest,
+          bbb_aware=False):
+    """Provides a new layer.
 
+    First, let's ignore the warnigns:
+    >>> warnings.filterwarnings('ignore', category=DeprecationWarning)
 
-def layer(_context, name=None, interface=None, base=IBrowserRequest):
-    """Provides a new layer.
-
+    >>> class Info(object):
+    ...     file = u'doctest'
+    ...     line = 1
+    ... 
     >>> class Context(object):
-    ...     info = u'doc'
+    ...     info = Info()
     ...     def __init__(self): self.actions = []
     ...     def action(self, **kw): self.actions.append(kw)
 
     Possibility 1: The Old Way
     --------------------------
-    
+
     >>> context = Context()
     >>> layer(context, u'layer1')
     >>> iface = context.actions[0]['args'][1]
@@ -61,6 +66,7 @@
     'layer1'
     >>> ILayer.providedBy(iface)
     True
+    >>> import sys
     >>> hasattr(sys.modules['zope.app.layers'], 'layer1')
     True
 
@@ -129,6 +135,9 @@
     Traceback (most recent call last):
     ...
     ConfigurationError: You cannot specify the 'interface' and 'base' together.
+
+    Enabling the warnings again:
+    >>> warnings.resetwarnings()
     """
     if name is not None and ',' in name:
         raise TypeError("Commas are not allowed in layer names.")
@@ -146,15 +155,27 @@
             "You cannot specify the 'interface' and 'base' together.")
 
     if interface is None:
+        if not bbb_aware:
+            warnings.warn_explicit(
+                'Creating layers via ZCML has been deprecated.  The '
+                'browser:layer directive will be removed in Zope 3.5.  Layers '
+                'are now interfaces extending zope.publisher.interfaces.browser'
+                '.IBrowserRequest. They do not need further registration.',
+                DeprecationWarning, _context.info.file, _context.info.line)
         interface = InterfaceClass(str(name), (base, ),
                                    __doc__='Layer: %s' %str(name),
                                    __module__='zope.app.layers')
         # Add the layer to the layers module.
         # Note: We have to do this immediately, so that directives using the
         # InterfaceField can find the layer.
-        setattr(zope.app.layers, name, interface)
+        layers.set(name, interface)
         path = 'zope.app.layers.'+name
     else:
+        if not bbb_aware:
+            warnings.warn_explicit(
+                'Layer interfaces do not require registration anymore.  The '
+                'browser:layer directive will be removed in Zope 3.5.',
+                DeprecationWarning, _context.info.file, _context.info.line)
         path = interface.__module__ + '.' + interface.getName()
 
         # If a name was specified, make this layer available under this name.
@@ -166,7 +187,7 @@
             # Make the interface available in the `zope.app.layers` module, so
             # that other directives can find the interface under the name
             # before the CA is setup.
-            setattr(zope.app.layers, name, interface)
+            layers.set(name, interface)
 
     # Register the layer interface as an interface
     _context.action(
@@ -185,12 +206,20 @@
         args = (name, interface, ILayer, _context.info)
         )
 
+# BBB 2006/02/18, to be removed after 12 months
 def skin(_context, name=None, interface=None, layers=None):
     """Provides a new skin.
 
+    First, let's ignore the warnigns:
+    >>> warnings.filterwarnings('ignore', category=DeprecationWarning)
+
     >>> import pprint
+    >>> class Info(object):
+    ...     file = u'doctest'
+    ...     line = 1
+    ... 
     >>> class Context(object):
-    ...     info = u'doc'
+    ...     info = Info()
     ...     def __init__(self): self.actions = []
     ...     def action(self, **kw): self.actions.append(kw)
 
@@ -208,6 +237,7 @@
     >>> pprint.pprint(iface.__bases__)
     (<InterfaceClass zope.app.publisher.browser.metaconfigure.Layer1>,
      <InterfaceClass zope.app.publisher.browser.metaconfigure.Layer2>)
+    >>> import sys
     >>> hasattr(sys.modules['zope.app.skins'], 'skin1')
     True
 
@@ -248,12 +278,21 @@
     Traceback (most recent call last):
     ...
     ConfigurationError: You must specify the 'name' or 'interface' attribute.
+
+    Enabling the warnings again:
+    >>> warnings.resetwarnings()
     """
     if name is None and interface is None: 
         raise ConfigurationError(
             "You must specify the 'name' or 'interface' attribute.")
 
     if name is not None and layers is not None:
+        warnings.warn_explicit(
+            'Creating skins via ZCML has been deprecated.  The browser:skin '
+            'directive will be removed in Zope 3.5.  Skins are now interfaces '
+            'extending zope.publisher.interfaces.browser.IBrowserRequest. '
+            'They are registered using the \'interface\' directive.',
+            DeprecationWarning, _context.info.file, _context.info.line)
         interface = InterfaceClass(str(name), layers,
                                    __doc__='Skin: %s' %str(name),
                                    __module__='zope.app.skins')
@@ -261,7 +300,7 @@
         # Add the layer to the skins module.
         # Note: We have to do this immediately, so that directives using the
         # InterfaceField can find the layer.
-        setattr(zope.app.skins, name, interface)
+        skins.set(name, interface)
         path = 'zope.app.skins'+name
 
         # Register the layers
@@ -274,13 +313,23 @@
 
     else:
         path = interface.__module__ + '.' + interface.getName()
+        warnings.warn_explicit(
+            'The browser:skin directive has been deprecated and will be '
+            'removed in Zope 3.5.  Skins are now simply registered using '
+            'the \'interface\' directive:\n'
+            '  <interface\n'
+            '      interface="%s"\n'
+            '      type="zope.publisher.interfaces.browser.IBrowserSkinType"\n'
+            '      name="%s"\n'
+            '      />' % (path, name),
+            DeprecationWarning, _context.info.file, _context.info.line)
 
         # Register the skin interface as a skin using the passed name.
         if name is not None:
             _context.action(
                 discriminator = ('skin', name),
                 callable = provideInterface,
-                args = (name, interface, ISkin, _context.info)
+                args = (name, interface, IBrowserSkinType, _context.info)
                 )
         
         name = path
@@ -297,7 +346,7 @@
     _context.action(
         discriminator = ('skin', name),
         callable = provideInterface,
-        args = (name, interface, ISkin, _context.info)
+        args = (name, interface, IBrowserSkinType, _context.info)
         )
 
 def setDefaultSkin(name, info=''):
@@ -307,9 +356,9 @@
     >>> from zope.app.testing import ztapi
 
     >>> class Skin1: pass
-    >>> directlyProvides(Skin1, ISkin)
+    >>> directlyProvides(Skin1, IBrowserSkinType)
 
-    >>> ztapi.provideUtility(ISkin, Skin1, 'Skin1')
+    >>> ztapi.provideUtility(IBrowserSkinType, Skin1, 'Skin1')
     >>> setDefaultSkin('Skin1')
     >>> adapters = zapi.getSiteManager().adapters
 
@@ -318,7 +367,7 @@
     >>> adapters.lookup((IBrowserRequest,), IDefaultSkin, '') is Skin1
     True
     """
-    skin = zapi.getUtility(ISkin, name)
+    skin = zapi.getUtility(IBrowserSkinType, name)
     handler('provideAdapter',
             (IBrowserRequest,), IDefaultSkin, '', skin, info),
 

Modified: Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -20,7 +20,7 @@
 from zope.interface import Interface
 from zope.configuration.fields import GlobalObject, GlobalInterface
 from zope.configuration.fields import Tokens, Path, PythonIdentifier, MessageID
-from zope.schema import TextLine, Text, Id, Int
+from zope.schema import TextLine, Text, Id, Int, Bool
 
 from zope.app.component.metadirectives import IBasicViewInformation
 from zope.app.component.fields import LayerField
@@ -566,6 +566,7 @@
 # misc. directives
 #
 
+# BBB 2006/02/18, to be removed after 12 months
 class ILayerDirective(Interface):
     """Defines a browser layer
 
@@ -599,6 +600,13 @@
         required=False
         )
 
+    bbb_aware = Bool(
+        title=u"BBB-aware",
+        description=u"Backward-compatability aware?",
+        required=False
+        )
+
+# BBB 2006/02/18, to be removed after 12 months
 class ISkinDirective(Interface):
     """Defines a browser skin
 

Modified: Zope3/trunk/src/zope/app/publisher/browser/tests/addmenuitems.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/addmenuitems.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/addmenuitems.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -3,14 +3,12 @@
     xmlns:browser="http://namespaces.zope.org/browser"
     i18n_domain="zope">
 
-  <browser:layer name="center"/>
-
   <browser:addform
       schema=".tests.test_menudirectives.I1"
       name="add2.html"
       content_factory=".tests.test_menudirectives.C1"
       permission="zope.Public"
-      layer="center"
+      layer="zope.app.publisher.browser.tests.test_addMenuItem.ILayerStub"
       />
 
   <browser:addMenuItem
@@ -18,7 +16,7 @@
       title="Add menu Item"
       view="add2.html"
       permission="zope.Public" 
-      layer="center"
+      layer="zope.app.publisher.browser.tests.test_addMenuItem.ILayerStub"
       />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/publisher/browser/tests/test_addMenuItem.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/test_addMenuItem.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/test_addMenuItem.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -64,6 +64,7 @@
 import pprint
 import cStringIO
 from zope.interface import Interface
+from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.app.publisher.browser.menumeta import addMenuItem
 
 atre = re.compile(' at [0-9a-fA-Fx]+')
@@ -74,7 +75,7 @@
 class X(object):
     pass
 
-class ILayerStub(Interface):
+class ILayerStub(IBrowserRequest):
     pass
 
 class MenuStub(object):

Modified: Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -26,10 +26,9 @@
 from zope.configuration.xmlconfig import xmlconfig, XMLConfig
 from zope.configuration.exceptions import ConfigurationError
 from zope.publisher.browser import TestRequest
-from zope.publisher.interfaces import ILayer
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import ISkin, IDefaultSkin
+from zope.publisher.interfaces.browser import IBrowserSkinType, IDefaultSkin
 from zope.security.proxy import removeSecurityProxy, ProxyFactory
 from zope.testing.doctestunit import DocTestSuite
 
@@ -104,10 +103,12 @@
 
 directlyProvides(ITestMenu, IMenuItemType)
 
+
 class ITestLayer(IBrowserRequest):
     """Test Layer."""
 
-directlyProvides(ITestLayer, ILayer)
+class ITestSkin(ITestLayer):
+    """Test Skin."""
 
 
 class MyResource(object):
@@ -123,29 +124,6 @@
         XMLConfig('meta.zcml', zope.app.publisher.browser)()
         ztapi.provideAdapter(None, ITraversable, DefaultTraversable)
 
-    def testLayer(self):
-        self.assertEqual(zapi.queryMultiAdapter((ob, request), name='test'),
-                         None)
-        xmlconfig(StringIO(
-            template % '<browser:layer name="testlayer" />'
-            ))
-        testlayer = zapi.getUtility(ILayer, "testlayer")
-        import zope.app.layers
-        self.assert_(zope.app.layers.testlayer is testlayer)
-
-    def testSkin(self):
-        self.assertEqual(zapi.queryMultiAdapter((ob, request), name='test'),
-                         None)
-        xmlconfig(StringIO(template % (
-            '''
-            <browser:layer name="default" />
-            <browser:skin name="testskin" layers="default" />
-            '''
-            )))
-        testskin = zapi.getUtility(ISkin, "testskin")
-        import zope.app.skins
-        self.assert_(zope.app.skins.testskin is testskin)
-
     def testPage(self):
         self.assertEqual(zapi.queryMultiAdapter((ob, request), name='test'),
                          None)
@@ -328,38 +306,45 @@
 
         xmlconfig(StringIO(template % (
             '''
-            <browser:layer name="zmi" />
-            <browser:skin name="zmi" layers="zmi" />
             <browser:resource
                 name="test"
                 factory="zope.app.component.tests.views.RZMI"
-                layer="zmi" />
+                layer="
+                  zope.app.publisher.browser.tests.test_directives.ITestLayer"
+                />
             <browser:resource
                 name="test"
-                factory="zope.app.component.tests.views.R1" />
+                factory="zope.app.component.tests.views.R1"
+                />
             '''
             )))
 
         self.assertEqual(
             zapi.queryAdapter(request, name='test').__class__, R1)
-        zmi = zapi.getUtility(ISkin, 'zmi')
         self.assertEqual(
-            zapi.queryAdapter(TestRequest(skin=zmi), name='test').__class__,
+            zapi.queryAdapter(TestRequest(skin=ITestSkin), name='test').__class__,
             RZMI)
 
     def testDefaultSkin(self):
         request = TestRequest()
-
         self.assertEqual(zapi.queryMultiAdapter((ob, request), name='test'),
                          None)
+
+        XMLConfig('meta.zcml', zope.app.component)()        
         xmlconfig(StringIO(template % (
             '''
-            <browser:layer name="zmi" />
-            <browser:skin name="zmi" layers="zmi" />
-            <browser:defaultSkin name="zmi" />
-            <browser:page name="test"
+            <interface
+                interface="
+                  zope.app.publisher.browser.tests.test_directives.ITestSkin"
+                type="zope.publisher.interfaces.browser.IBrowserSkinType"
+                name="Test Skin"
+                />
+            <browser:defaultSkin name="Test Skin" />
+            <browser:page
+                name="test"
                 class="zope.app.component.tests.views.VZMI"
-                layer="zmi"
+                layer="
+                  zope.app.publisher.browser.tests.test_directives.ITestLayer"
                 for="zope.app.component.tests.views.IC"
                 permission="zope.Public"
                 attribute="index"
@@ -387,11 +372,10 @@
 
         xmlconfig(StringIO(template % (
             '''
-            <browser:layer name="zmi" />
-            <browser:skin name="zmi" layers="zmi" />
             <browser:page name="test"
                 class="zope.app.component.tests.views.VZMI"
-                layer="zmi"
+                layer="
+                  zope.app.publisher.browser.tests.test_directives.ITestLayer"
                 for="zope.app.component.tests.views.IC"
                 permission="zope.Public"
                 attribute="index"
@@ -407,8 +391,7 @@
 
         v = zapi.queryMultiAdapter((ob, request), name='test')
         self.assert_(issubclass(v.__class__, V1))
-        zmi = zapi.getUtility(ISkin, 'zmi')
-        v = zapi.queryMultiAdapter((ob, TestRequest(skin=zmi)), name='test')
+        v = zapi.queryMultiAdapter((ob, TestRequest(skin=ITestSkin)), name='test')
         self.assert_(issubclass(v.__class__, VZMI))
 
     def testI18nResource(self):
@@ -870,23 +853,21 @@
 
         xmlconfig(StringIO(template %
             '''
-            <browser:layer name="layer" />
-            <browser:skin name="skinny" layers="layer" />
             <browser:pages
                 for="*"
                 class="zope.app.component.tests.views.V1"
                 permission="zope.Public"
-                >
-             
+                >             
               <browser:page name="index.html" attribute="index" />
             </browser:pages>
+
             <browser:pages
                 for="*"
                 class="zope.app.component.tests.views.V1"
-                layer="layer"
+                layer="
+                  zope.app.publisher.browser.tests.test_directives.ITestLayer"
                 permission="zope.Public"
                 >
-            
               <browser:page name="index.html" attribute="action" />
             </browser:pages>
             '''
@@ -894,8 +875,7 @@
 
         v = zapi.getMultiAdapter((ob, request), name='index.html')
         self.assertEqual(v(), 'V1 here')
-        skinny = zapi.getUtility(ISkin, 'skinny')
-        v = zapi.getMultiAdapter((ob, TestRequest(skin=skinny)),
+        v = zapi.getMultiAdapter((ob, TestRequest(skin=ITestSkin)),
                                  name='index.html')
         self.assertEqual(v(), 'done')
 
@@ -952,20 +932,20 @@
         self.assertEqual(zapi.queryAdapter(request, name='test'), None)
 
         path = os.path.join(tests_path, 'testfiles', 'test.pt')
-
         xmlconfig(StringIO(template % (
             '''
-            <browser:layer name="zmi" />
-            <browser:skin name="zmi" layers="zmi" />
-            <browser:resource name="test" file="%s" 
-                  layer="zmi" />
+            <browser:resource
+                name="test"
+                file="%s" 
+                layer="
+                  zope.app.publisher.browser.tests.test_directives.ITestLayer"
+                />
             ''' % path
             )))
 
         self.assertEqual(zapi.queryAdapter(request, name='test'), None)
 
-        zmi = zapi.getUtility(ISkin, 'zmi')
-        r = zapi.getAdapter(TestRequest(skin=zmi), name='test')
+        r = zapi.getAdapter(TestRequest(skin=ITestSkin), name='test')
         r = removeSecurityProxy(r)
         self.assertEqual(r._testData(), open(path, 'rb').read())
 
@@ -1001,11 +981,6 @@
                 title="Test menu"
                 interface="zope.app.publisher.browser.tests.test_directives.ITestMenu"/>
 
-            <browser:layer 
-                name="test_layer"
-                interface="zope.app.publisher.browser.tests.test_directives.ITestLayer"
-                />
-
             <browser:page
                 name="index.html"
                 permission="zope.Public"

Modified: Zope3/trunk/src/zope/app/rotterdam/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/rotterdam/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""`Rotterdam` skin package.
+"""``Rotterdam`` skin package.
 
 $Id$
 """
@@ -20,11 +20,14 @@
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 
 class rotterdam(IBrowserRequest):
-    """The `rotterdam` layer."""
+    """Layer for registering Rotterdam-specific macros."""
 
 class Rotterdam(rotterdam, IDefaultBrowserLayer):
-    """The `Rotterdam` skin.
+    """The ``Rotterdam`` skin.
 
-    It is available via `++skin++zope.app.rotterdam.Rotterdam`.
+    It is available via ``++skin++Rotterdam``.
     """
 
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('Rotterdam', Rotterdam)


Property changes on: Zope3/trunk/src/zope/app/rotterdam/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zope/app/rotterdam/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/rotterdam/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -2,14 +2,18 @@
     xmlns="http://namespaces.zope.org/zope"
     xmlns:browser="http://namespaces.zope.org/browser">
 
-
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
   <browser:layer
       name="rotterdam"
-      interface="zope.app.rotterdam.rotterdam" />
+      interface="zope.app.rotterdam.rotterdam"
+      bbb_aware="true"
+      />
 
-  <browser:skin
+  <interface
+      interface="zope.app.rotterdam.Rotterdam"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="Rotterdam"
-      interface="zope.app.rotterdam.Rotterdam" />
+      />
 
   <browser:resource
       name="zope3.css"

Copied: Zope3/trunk/src/zope/app/skins.py (from rev 65508, Zope3/branches/philikon-simplify-skinning/src/zope/app/skins.py)

Modified: Zope3/trunk/src/zope/app/traversing/namespace.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/namespace.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/traversing/namespace.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -23,7 +23,7 @@
 from zope.i18n.interfaces import IModifiableUserPreferredLanguages
 from zope.component.exceptions import ComponentLookupError
 from zope.interface import providedBy, directlyProvides, directlyProvidedBy
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.security.proxy import removeSecurityProxy
 
 from zope.app.publisher.browser import applySkin
@@ -385,7 +385,7 @@
 
     def traverse(self, name, ignored):
         self.request.shiftNameToApplication()
-        skin = zope.component.getUtility(ISkin, name)
+        skin = zope.component.getUtility(IBrowserSkinType, name)
         applySkin(self.request, skin)
         return self.context
 
@@ -507,8 +507,8 @@
 
             >>> class Debug(IBrowserRequest):
             ...     pass
-            >>> directlyProvides(Debug, ISkin)
-            >>> ztapi.provideUtility(ISkin, Debug, 'Debug')
+            >>> directlyProvides(Debug, IBrowserSkinType)
+            >>> ztapi.provideUtility(IBrowserSkinType, Debug, 'Debug')
 
             >>> Debug.providedBy(request)
             False
@@ -542,7 +542,7 @@
                     # TODO: I am not sure this is the best solution.  What
                     # if we want to enable tracebacks when also trying to
                     # debug a different skin?
-                    skin = zope.component.getUtility(ISkin, 'Debug')
+                    skin = zope.component.getUtility(IBrowserSkinType, 'Debug')
                     directlyProvides(request, providedBy(request)+skin)
                 else:
                     raise ValueError("Unknown debug flag: %s" % flag)

Modified: Zope3/trunk/src/zope/app/traversing/tests/test_skin.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/tests/test_skin.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/traversing/tests/test_skin.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -18,7 +18,7 @@
 from unittest import TestCase, main, makeSuite
 from zope.interface import Interface, directlyProvides
 
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.app.testing import ztapi
 from zope.app.testing.placelesssetup import PlacelessSetup
 
@@ -29,14 +29,14 @@
 
 class IFoo(Interface):
     pass
-directlyProvides(IFoo, ISkin)
+directlyProvides(IFoo, IBrowserSkinType)
 
 
 class Test(PlacelessSetup, TestCase):
 
     def setUp(self):
         super(Test, self).setUp()
-        ztapi.provideUtility(ISkin, IFoo, 'foo')
+        ztapi.provideUtility(IBrowserSkinType, IFoo, 'foo')
 
     def test(self):
         from zope.app.traversing.namespace import skin

Modified: Zope3/trunk/src/zope/app/tree/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/tree/browser/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/tree/browser/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -15,13 +15,28 @@
 
 $Id$
 """
+__docformat__ = 'restructuredtext'
 
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import Rotterdam
+
 from zope.app import zapi
 from zope.app.publisher.browser import BrowserView
 
 from zope.app.tree.interfaces import ITreeStateEncoder
 from zope.app.tree.node import Node
 
+class IStaticTreeLayer(IBrowserRequest):
+    """Layer that we can register our own navigation macro for."""
+
+class IStaticTreeSkin(IStaticTreeLayer, Rotterdam):
+    """Skin based on Rotterdam that includes the static tree
+    navigation macro."""
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('StaticTree', IStaticTreeSkin)
+
 class StatefulTreeView(BrowserView):
 
     def statefulTree(self, root=None, filter=None, tree_state=None):

Modified: Zope3/trunk/src/zope/app/tree/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/tree/browser/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/tree/browser/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -40,17 +40,25 @@
   </browser:pages>
 
   <!-- Set up the 'StaticTree' skin -->
-  <browser:layer name="statictree" />
 
-  <browser:skin
+  <!-- BBB 2006/02/18, to be removed after 12 months -->
+  <browser:layer
+      interface=".IStaticTreeLayer"
+      name="statictree"
+      bbb_aware="true"
+      />
+
+  <interface
+      interface=".IStaticTreeSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="StaticTree"
-      layers="statictree zope.app.rotterdam.rotterdam default"
       />
+
   <browser:page
       for="*"
       name="navigation_macros"
       permission="zope.View"
-      layer="statictree"
+      layer=".IStaticTreeLayer"
       template="navigation_macros.pt"
       />
 

Modified: Zope3/trunk/src/zope/app/zopetop/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/zopetop/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -36,3 +36,6 @@
     This skin consists of its three specific layers plus the rotterdam layer.
     """
 
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('ZopeTop', ZopeTop)

Modified: Zope3/trunk/src/zope/app/zopetop/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/zopetop/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -2,9 +2,11 @@
   xmlns:zope="http://namespaces.zope.org/zope"
   xmlns="http://namespaces.zope.org/browser">
 
-  <skin
+  <zope:interface
+      interface="zope.app.zopetop.ZopeTop"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
       name="ZopeTop"
-      interface="zope.app.zopetop.ZopeTop" />
+      />
 
   <page
       for="*"

Modified: Zope3/trunk/src/zope/app/zopetop/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/ftests.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/app/zopetop/ftests.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -24,10 +24,8 @@
     """Funcional tests for ZopeTop skin."""
 
     def test_ZopeTopIsNotRotterdam(self):
-        response1 = self.publish("/++skin++zope.app.rotterdam.Rotterdam",
-                                 basic='mgr:mgrpw')
-        response2 = self.publish("/++skin++zope.app.zopetop.ZopeTop",
-                                 basic='mgr:mgrpw')
+        response1 = self.publish("/++skin++Rotterdam", basic='mgr:mgrpw')
+        response2 = self.publish("/++skin++ZopeTop", basic='mgr:mgrpw')
         self.assert_(response1.getBody() != response2.getBody())
 
 def test_suite():

Modified: Zope3/trunk/src/zope/deprecation/README.txt
===================================================================
--- Zope3/trunk/src/zope/deprecation/README.txt	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/deprecation/README.txt	2006-02-27 05:24:24 UTC (rev 65511)
@@ -60,6 +60,20 @@
   >>> tests.demo1
   1
 
+Deprecation can also happen inside a function.  When we first access
+``demo4``, it can be accessed without problems, then we call a
+function that sets the deprecation message and we get the message upon
+the next access:
+
+  >>> tests.demo4
+  4
+  >>> tests.deprecatedemo4()
+  >>> tests.demo4
+  From tests.py's showwarning():
+  ...README.txt:1: DeprecationWarning: demo4: demo4 is no more.
+  ...
+  4
+
 New let's see how properties and methods can be deprecated. We are going to
 use the same function as before, except that this time, we do not pass in names
 as first argument, but the method or attribute itself. The function then

Modified: Zope3/trunk/src/zope/deprecation/deprecation.py
===================================================================
--- Zope3/trunk/src/zope/deprecation/deprecation.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/deprecation/deprecation.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -131,9 +131,8 @@
 
     # We are inside a module
     if isinstance(specifier, (str, unicode, list, tuple)):
-        locals = sys._getframe(1).f_locals
-        if '__name__' in locals:
-            modname = locals['__name__']
+        globals = sys._getframe(1).f_globals
+        modname = globals['__name__']
 
         if not isinstance(sys.modules[modname], DeprecationProxy):
             sys.modules[modname] = DeprecationProxy(sys.modules[modname])

Modified: Zope3/trunk/src/zope/deprecation/tests.py
===================================================================
--- Zope3/trunk/src/zope/deprecation/tests.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/deprecation/tests.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -13,7 +13,7 @@
 ##############################################################################
 """Component Architecture Tests
 
-$Id: test_api.py 28632 2004-12-16 17:42:59Z srichter $
+$Id$
 """
 import sys
 import unittest
@@ -31,6 +31,10 @@
 demo3 = 3
 deprecated('demo3', 'demo3 is no more.')
 
+demo4 = 4
+def deprecatedemo4():
+    """Demonstrate that deprecate() also works in a local scope."""
+    deprecated('demo4', 'demo4 is no more.')
 
 orig_showwarning = warnings.showwarning
 

Modified: Zope3/trunk/src/zope/publisher/interfaces/__init__.py
===================================================================
--- Zope3/trunk/src/zope/publisher/interfaces/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/publisher/interfaces/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -463,6 +463,19 @@
     """
 
 
+##############################################################################
+#
+# BBB 2006/02/18, to be removed after 12 months
+#
+
 class ILayer(IInterface):
     """A grouping of related views for a request."""
 
+import zope.deprecation
+zope.deprecation.deprecated('ILayer',
+                            'The zope.publisher.interfaces.ILayer '
+                            'interface has been deprecated and will '
+                            'go away in Zope 3.5.')
+
+#
+##############################################################################

Modified: Zope3/trunk/src/zope/publisher/interfaces/browser.py
===================================================================
--- Zope3/trunk/src/zope/publisher/interfaces/browser.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/publisher/interfaces/browser.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -23,7 +23,6 @@
 
 from zope.publisher.interfaces import IPublication
 from zope.publisher.interfaces import IPublishTraverse
-from zope.publisher.interfaces import ILayer
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
 from zope.publisher.interfaces.http import IHTTPRequest
 
@@ -110,12 +109,31 @@
 
 class IDefaultBrowserLayer(IBrowserRequest):
     """The default layer."""
-directlyProvides(IDefaultBrowserLayer, ILayer)
 
-class ISkin(IInterface):
+class IBrowserSkinType(IInterface):
     """A skin is a set of layers."""
 
+##############################################################################
+#
+# BBB 2006/02/18, to be removed after 12 months
+#
 
+# mark the default layer for BBB reasons
+import zope.deprecation
+zope.deprecation.__show__.off()
+from zope.publisher.interfaces import ILayer
+zope.deprecation.__show__.on()
+directlyProvides(IDefaultBrowserLayer, ILayer)
+
+import zope.deprecation
+ISkin = IBrowserSkinType
+zope.deprecation.deprecated('ISkin',
+                            'The zope.publisher.interfaces.browser.ISkin '
+                            'interface has been renamed to IBrowserSkinType. '
+                            'The old alias will go away in Zope 3.5.')
+#
+##############################################################################
+
 class IDefaultSkin(Interface):
     """Any component providing this interface must be a skin.
 

Modified: Zope3/trunk/src/zope/publisher/tests/basetestipublicationrequest.py
===================================================================
--- Zope3/trunk/src/zope/publisher/tests/basetestipublicationrequest.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/publisher/tests/basetestipublicationrequest.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -20,7 +20,7 @@
 from zope.interface import Interface, directlyProvides, implements
 from zope.interface.verify import verifyObject
 from zope.publisher.interfaces import IPublicationRequest, IHeld
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
 
 class Held:
     implements(IHeld)
@@ -77,7 +77,7 @@
 
         class IMoreFoo(Interface):
             pass
-        directlyProvides(IMoreFoo, ISkin)
+        directlyProvides(IMoreFoo, IBrowserSkinType)
 
         self.assertEqual(IMoreFoo.providedBy(request), False)
         directlyProvides(request, IMoreFoo)

Modified: Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py
===================================================================
--- Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zope/publisher/tests/test_browserrequest.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -27,7 +27,7 @@
 
 from zope.publisher.base import DefaultPublication
 from zope.publisher.interfaces.browser import IBrowserApplicationRequest
-from zope.publisher.interfaces.browser import IBrowserRequest, ISkin
+from zope.publisher.interfaces.browser import IBrowserRequest
 
 from StringIO import StringIO
 

Modified: Zope3/trunk/src/zwiki/browser/skin/__init__.py
===================================================================
--- Zope3/trunk/src/zwiki/browser/skin/__init__.py	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zwiki/browser/skin/__init__.py	2006-02-27 05:24:24 UTC (rev 65511)
@@ -1 +1,29 @@
-# make this directory a package
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Wiki skin
+
+$Id$
+"""
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import Rotterdam
+
+class IWikiLayer(IBrowserRequest):
+    """Layer that we register wiki-specific views with"""
+
+class IWikiSkin(IWikiLayer, Rotterdam):
+    """Wiki skin"""
+
+# BBB 2006/02/18, to be removed after 12 months
+import zope.app.skins
+zope.app.skins.set('wiki', IWikiSkin)


Property changes on: Zope3/trunk/src/zwiki/browser/skin/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zwiki/browser/skin/configure.zcml
===================================================================
--- Zope3/trunk/src/zwiki/browser/skin/configure.zcml	2006-02-27 05:23:56 UTC (rev 65510)
+++ Zope3/trunk/src/zwiki/browser/skin/configure.zcml	2006-02-27 05:24:24 UTC (rev 65511)
@@ -3,9 +3,20 @@
     xmlns:browser="http://namespaces.zope.org/browser"
     i18n_domain="zwiki"
     >
-<browser:layer name="wiki" />
-<browser:skin name="wiki" layers="wiki zope.app.rotterdam.rotterdam default" />
 
+<!-- BBB 2006/02/18, to be removed after 12 months -->
+<browser:layer
+    interface=".IWikiLayer"
+    name="wiki"
+    bbb_aware="true"
+    />
+
+<interface
+    interface=".IWikiSkin"
+    type="zope.publisher.interfaces.browser.IBrowserSkinType"
+    name="wiki"
+    />
+
 <browser:resource
     name="wiki.css" file="wiki.css" layer="wiki" />
 



More information about the Zope3-Checkins mailing list