[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Make deprecated
packages zope.app.layers and zope.app.skins optional.
Florent Xicluna
laxyf at yahoo.fr
Wed Sep 13 09:02:08 EDT 2006
Log message for revision 70148:
Make deprecated packages zope.app.layers and zope.app.skins optional.
By the way, a zcml feature 'deprecatedlayers' is added.
Note: this is backward-compatible, by default these packages are installed and active.
Changed:
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/basicskin/__init__.py
U Zope3/trunk/src/zope/app/boston/__init__.py
U Zope3/trunk/src/zope/app/boston/configure.zcml
U Zope3/trunk/src/zope/app/css/__init__.py
U Zope3/trunk/src/zope/app/css/configure.zcml
U Zope3/trunk/src/zope/app/debugskin/__init__.py
U Zope3/trunk/src/zope/app/debugskin/configure.zcml
A Zope3/trunk/src/zope/app/layers/SETUP.cfg
A Zope3/trunk/src/zope/app/layers/meta.zcml
A Zope3/trunk/src/zope/app/layers/zope.app.layers-meta.zcml
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/rotterdam/__init__.py
U Zope3/trunk/src/zope/app/rotterdam/configure.zcml
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
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,10 +1,12 @@
<configure
xmlns="http://namespaces.zope.org/browser"
xmlns:zope="http://namespaces.zope.org/zope"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
i18n_domain="zope">
<!-- BBB 2006/02/18, to be removed after 12 months -->
<layer
+ zcml:condition="have deprecatedlayers"
name="apidoc"
interface=".skin.apidoc"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/apidoc/browser/skin.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/skin.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/apidoc/browser/skin.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -27,5 +27,8 @@
"""The `APIDOC` skin."""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('APIDOC', APIDOC)
+try:
+ import zope.app.skins
+ zope.app.skins.set('APIDOC', APIDOC)
+except ImportError:
+ pass
Modified: Zope3/trunk/src/zope/app/basicskin/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/basicskin/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/basicskin/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -23,5 +23,8 @@
nothing else"""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('Basic', IBasicSkin)
+try:
+ import zope.app.skins
+ zope.app.skins.set('Basic', IBasicSkin)
+except ImportError:
+ pass
Modified: Zope3/trunk/src/zope/app/boston/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/boston/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/boston/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -34,8 +34,11 @@
"""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('Boston', Boston)
+try:
+ import zope.app.skins
+ zope.app.skins.set('Boston', Boston)
+except ImportError:
+ pass
class IHead(IViewletManager):
"""Head viewlet manager."""
Modified: Zope3/trunk/src/zope/app/boston/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/boston/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/boston/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -7,6 +7,7 @@
<!-- BBB 2006/02/18, to be removed after 12 months -->
<layer
+ zcml:condition="have deprecatedlayers"
name="boston"
interface="zope.app.boston.boston"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/css/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/css/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/css/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -31,5 +31,8 @@
"""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('CSS', CSS)
+try:
+ import zope.app.skins
+ zope.app.skins.set('CSS', CSS)
+except ImportError:
+ pass
Modified: Zope3/trunk/src/zope/app/css/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/css/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/css/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,9 +1,11 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml">
<!-- BBB 2006/02/18, to be removed after 12 months -->
<browser:layer
+ zcml:condition="have deprecatedlayers"
name="css"
interface="zope.app.css.layer"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/debugskin/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/debugskin/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -26,5 +26,8 @@
"""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)
+try:
+ import zope.app.skins
+ zope.app.skins.set('Debug', IDebugSkin)
+except ImportError:
+ pass
Modified: Zope3/trunk/src/zope/app/debugskin/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/debugskin/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,10 +1,12 @@
<configure
xmlns="http://namespaces.zope.org/browser"
xmlns:zope="http://namespaces.zope.org/zope"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
>
<!-- BBB 2006/02/18, to be removed after 12 months -->
<layer
+ zcml:condition="have deprecatedlayers"
interface=".IDebugLayer"
name="debug"
bbb_aware="true"
Added: Zope3/trunk/src/zope/app/layers/SETUP.cfg
===================================================================
--- Zope3/trunk/src/zope/app/layers/SETUP.cfg 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/layers/SETUP.cfg 2006-09-13 13:02:06 UTC (rev 70148)
@@ -0,0 +1,5 @@
+# Tell zpkg how to install the ZCML slugs.
+
+<data-files zopeskel/etc/package-includes>
+ zope.app.layers-*.zcml
+</data-files>
Added: Zope3/trunk/src/zope/app/layers/meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/layers/meta.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/layers/meta.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -0,0 +1,3 @@
+<configure xmlns:meta="http://namespaces.zope.org/meta">
+ <meta:provides feature="deprecatedlayers" />
+</configure>
Property changes on: Zope3/trunk/src/zope/app/layers/meta.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/layers/zope.app.layers-meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/layers/zope.app.layers-meta.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/layers/zope.app.layers-meta.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -0,0 +1 @@
+<include package="zope.app.layers" file="meta.zcml" />
Property changes on: Zope3/trunk/src/zope/app/layers/zope.app.layers-meta.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/publisher/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/publisher/browser/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,6 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml">
<interface
interface="zope.app.publisher.interfaces.browser.IMenuItemType" />
@@ -12,6 +13,7 @@
<!-- BBB 2006/02/18, to be removed after 12 months -->
<browser:layer
+ zcml:condition="have deprecatedlayers"
name="default"
interface="zope.publisher.interfaces.browser.IDefaultBrowserLayer"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/publisher/browser/meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/meta.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/publisher/browser/meta.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,6 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:meta="http://namespaces.zope.org/meta">
+ xmlns:meta="http://namespaces.zope.org/meta"
+ xmlns:zcml="http://namespaces.zope.org/zcml">
<meta:directives namespace="http://namespaces.zope.org/browser">
@@ -129,6 +130,7 @@
<!-- BBB 2006/02/18, to be removed after 12 months -->
<meta:directive
+ zcml:condition="have deprecatedlayers"
name="layer"
schema=".metadirectives.ILayerDirective"
handler=".metaconfigure.layer"
@@ -136,6 +138,7 @@
<!-- BBB 2006/02/18, to be removed after 12 months -->
<meta:directive
+ zcml:condition="have deprecatedlayers"
name="skin"
schema=".metadirectives.ISkinDirective"
handler=".metaconfigure.skin"
Modified: Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -25,7 +25,7 @@
from zope.publisher.interfaces.browser import IBrowserRequest, IDefaultSkin
from zope.publisher.interfaces.browser import IBrowserSkinType
-from zope.app import zapi, layers, skins
+from zope.app import zapi
# referred to through ZCML
from zope.app.publisher.browser.resourcemeta import resource
@@ -142,6 +142,7 @@
>>> warnings.showwarning = showwarning
"""
+ from zope.app import layers
if name is not None and ',' in name:
raise TypeError("Commas are not allowed in layer names.")
if name is None and interface is None:
@@ -286,6 +287,7 @@
Enabling the warnings again:
>>> warnings.showwarning = showwarning
"""
+ from zope.app import skins
if name is None and interface is None:
raise ConfigurationError(
"You must specify the 'name' or 'interface' attribute.")
Modified: Zope3/trunk/src/zope/app/rotterdam/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/rotterdam/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -29,5 +29,8 @@
"""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('Rotterdam', Rotterdam)
+try:
+ import zope.app.skins
+ zope.app.skins.set('Rotterdam', Rotterdam)
+except ImportError:
+ pass
Modified: Zope3/trunk/src/zope/app/rotterdam/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/rotterdam/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,9 +1,11 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml">
<!-- BBB 2006/02/18, to be removed after 12 months -->
<browser:layer
+ zcml:condition="have deprecatedlayers"
name="rotterdam"
interface="zope.app.rotterdam.rotterdam"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/tree/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/tree/browser/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/tree/browser/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -33,8 +33,11 @@
navigation macro."""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('StaticTree', IStaticTreeSkin)
+try:
+ import zope.app.skins
+ zope.app.skins.set('StaticTree', IStaticTreeSkin)
+except ImportError:
+ pass
class StatefulTreeView(BrowserView):
Modified: Zope3/trunk/src/zope/app/tree/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/tree/browser/configure.zcml 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/tree/browser/configure.zcml 2006-09-13 13:02:06 UTC (rev 70148)
@@ -1,6 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
i18n_domain="zope"
>
@@ -43,6 +44,7 @@
<!-- BBB 2006/02/18, to be removed after 12 months -->
<browser:layer
+ zcml:condition="have deprecatedlayers"
interface=".IStaticTreeLayer"
name="statictree"
bbb_aware="true"
Modified: Zope3/trunk/src/zope/app/zopetop/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/__init__.py 2006-09-13 12:39:54 UTC (rev 70147)
+++ Zope3/trunk/src/zope/app/zopetop/__init__.py 2006-09-13 13:02:06 UTC (rev 70148)
@@ -37,5 +37,8 @@
"""
# BBB 2006/02/18, to be removed after 12 months
-import zope.app.skins
-zope.app.skins.set('ZopeTop', ZopeTop)
+try:
+ import zope.app.skins
+ zope.app.skins.set('ZopeTop', ZopeTop)
+except ImportError:
+ pass
More information about the Zope3-Checkins
mailing list