Skip to content

Commit

Permalink
* Make zope.app.layers and zope.app.skins a proper module (even though
Browse files Browse the repository at this point in the history
  they're going to go away). Why they had to be created from Python
  is beyond me, or why they had to be created in the first place.

* Introduce a hook to zope.app.layers and zope.app.skins that lets skins
  and layers register themselves there.  We need this for BBB compat
  when we're using <interface /> now instead of <browser:skin />.
  Accessing the skins and layers through those modules will trigger a 
  deprecation warning.

* Add a BBB awareness parameter to the browser:layer directive that let's
  us continue to use it until its removed without issuing a deprecation
  warning.  We need to continue to use it for BBB reasons (because some
  code might be looking up layers by getting the ILayer utilities, for
  example).
  • Loading branch information
philikon committed Feb 19, 2006
1 parent 1296b61 commit a227487
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion browser/configure.zcml
Expand Up @@ -3,9 +3,12 @@
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"
/>

<zope:interface
interface=".skin.APIDOC"
Expand Down
31 changes: 31 additions & 0 deletions browser/skin.py
@@ -0,0 +1,31 @@
##############################################################################
#
# Copyright (c) 2004 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.
#
##############################################################################
"""`APIdoc` skin.
$Id$
"""
__docformat__ = "reStructuredText"

from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.browser import IDefaultBrowserLayer

class apidoc(IBrowserRequest):
"""The `apidoc` layer."""

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)

0 comments on commit a227487

Please sign in to comment.