[Zope3-checkins] SVN: Zope3/trunk/src/ Converted the main skins to use interfaces declared in Python, the new way

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 17 18:31:33 EDT 2004


Log message for revision 27629:
  Converted the main skins to use interfaces declared in Python, the new way 
  to do it. I also added a functional test that was supposed to point out 
  the failure we are having, but it passes!!!!!! Argh!
  
  
  


Changed:
  U   Zope3/trunk/src/bugtracker/browser/configure.zcml
  U   Zope3/trunk/src/bugtracker/browser/skin/configure.zcml
  U   Zope3/trunk/src/zope/app/browser.zcml
  U   Zope3/trunk/src/zope/app/debugskin/configure.zcml
  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/configure.zcml
  U   Zope3/trunk/src/zope/app/zopetop/__init__.py
  U   Zope3/trunk/src/zope/app/zopetop/configure.zcml
  A   Zope3/trunk/src/zope/app/zopetop/ftests.py
  U   Zope3/trunk/src/zwiki/browser/skin/configure.zcml


-=-
Modified: Zope3/trunk/src/bugtracker/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/bugtracker/browser/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/bugtracker/browser/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -6,7 +6,9 @@
   <zope:include package=".skin" />
 
   <resource 
-       name="tracker.css" file="tracker.css" layer="rotterdam" />
+       name="tracker.css" 
+       file="tracker.css" 
+       layer="zope.app.rotterdam.rotterdam" />
 
   <icon
       name="zmi_icon"

Modified: Zope3/trunk/src/bugtracker/browser/skin/configure.zcml
===================================================================
--- Zope3/trunk/src/bugtracker/browser/skin/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/bugtracker/browser/skin/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -2,7 +2,7 @@
 
   <layer name="tracker" />
 
-  <skin name="tracker" layers="tracker rotterdam default" />
+  <skin name="tracker" layers="tracker zope.app.rotterdam.rotterdam" />
 
   <page 
       for="*"

Modified: Zope3/trunk/src/zope/app/browser.zcml
===================================================================
--- Zope3/trunk/src/zope/app/browser.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/browser.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -3,7 +3,7 @@
    xmlns:browser="http://namespaces.zope.org/browser">
 
   <browser:defaultView name="index.html" />
-  <browser:defaultSkin name="Rotterdam" />
+  <browser:defaultSkin name="zope.app.rotterdam.Rotterdam" />
 
   <include package="zope.app.exception.browser" />
   <include package="zope.app.traversing.browser" />

Modified: Zope3/trunk/src/zope/app/debugskin/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/debugskin/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -3,7 +3,10 @@
    xmlns="http://namespaces.zope.org/browser">
 
   <layer name="debug" />
-  <skin name="Debug" layers="debug rotterdam default" />
+  <skin 
+      name="Debug" 
+      layers="debug 
+              zope.app.rotterdam.rotterdam" />
 
   <page
       for="zope.security.interfaces.IUnauthorized"

Modified: Zope3/trunk/src/zope/app/rotterdam/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/__init__.py	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/rotterdam/__init__.py	2004-09-17 22:31:32 UTC (rev 27629)
@@ -1 +1,29 @@
-# Make this directory a package.
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""`Rotterdam` skin package.
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.publisher.interfaces.browser import IBrowserRequest
+
+class rotterdam(IBrowserRequest):
+    """The `rotterdam` layer."""
+
+class Rotterdam(rotterdam):
+    """The `Rotterdam` skin.
+
+    It is available via `++skin++zope.app.rotterdam.Rotterdam`.
+    """

Modified: Zope3/trunk/src/zope/app/rotterdam/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/rotterdam/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -2,37 +2,53 @@
     xmlns="http://namespaces.zope.org/zope"
     xmlns:browser="http://namespaces.zope.org/browser">
 
-  <browser:layer
-      name="rotterdam" />
-  <browser:skin
-      name="Rotterdam" layers="rotterdam default" />
+  <browser:skin 
+      interface="zope.app.rotterdam.Rotterdam" />
   
   <browser:resource 
-      name="zope3.css" file="zope3.css" layer="rotterdam" />
+      name="zope3.css" 
+      file="zope3.css" 
+      layer="zope.app.rotterdam.rotterdam" />
 
   <browser:resource 
-      name="site_management.css" file="site_management.css" layer="rotterdam" />
+      name="site_management.css" 
+      file="site_management.css" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource 
-      name="xmltree.js" file="xmltree.js" layer="rotterdam" />
+      name="xmltree.js" 
+      file="xmltree.js" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource 
-      name="onlinehelp.js" file="onlinehelp.js" layer="rotterdam" />
+      name="onlinehelp.js" 
+      file="onlinehelp.js" 
+      layer="zope.app.rotterdam.rotterdam" />
       
    <browser:resource
-      name="favicon.png" file="favicon.png" layer="rotterdam" />
+      name="favicon.png" 
+      file="favicon.png" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource
-      name="zope3logo.gif" file="zope3logo.gif" layer="rotterdam" />
+      name="zope3logo.gif" 
+      file="zope3logo.gif" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource
-      name="logo.gif" file="logo.gif" layer="rotterdam" />
+      name="logo.gif" 
+      file="logo.gif" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource 
-      name="pl.gif" file="pl.gif" layer="rotterdam" />
+      name="pl.gif" 
+      file="pl.gif" 
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:resource 
-      name="mi.gif" file="mi.gif" layer="rotterdam" />
+      name="mi.gif" 
+      file="mi.gif"
+      layer="zope.app.rotterdam.rotterdam" />
   
   <browser:pages
       for="zope.app.container.interfaces.IReadContainer"
@@ -56,7 +72,7 @@
       name="standard_macros"
       permission="zope.View"
       class=".standardmacros.StandardMacros"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       allowed_interface="zope.interface.common.mapping.IItemMapping" 
       />
   
@@ -64,7 +80,7 @@
       for="*"
       name="skin_macros"
       permission="zope.View"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       template="template.pt" 
       />
   
@@ -72,21 +88,21 @@
       for="*"
       name="view_macros"
       permission="zope.View"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       template="view_macros.pt" />
   
   <browser:page
       for="*"
       name="dialog_macros"
       permission="zope.View"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       template="dialog_macros.pt" />
 
   <browser:page
       for="*"
       name="navigation_macros"
       permission="zope.View"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       template="navigation_macros.pt"
       />
 
@@ -94,7 +110,7 @@
       for="*"
       name="popup_macros"
       permission="zope.View"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       template="popup_macros.pt"
       />
 
@@ -104,7 +120,7 @@
       provides="zope.app.form.interfaces.IInputWidget"
       factory=".editingwidgets.SimpleEditingWidget"
       permission="zope.Public"
-      layer="rotterdam"
+      layer="zope.app.rotterdam.rotterdam"
       />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/tree/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/tree/browser/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/tree/browser/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -41,7 +41,7 @@
 
   <browser:skin
       name="StaticTree"
-      layers="statictree rotterdam default"
+      layers="statictree zope.app.rotterdam.rotterdam"
       />
 
   <browser:page

Modified: Zope3/trunk/src/zope/app/zopetop/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/__init__.py	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/zopetop/__init__.py	2004-09-17 22:31:32 UTC (rev 27629)
@@ -1,2 +1,37 @@
+##############################################################################
 #
-# This file is necessary to make this directory a package.
+# 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.
+#
+##############################################################################
+"""`ZopeTop` skin package.
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import rotterdam
+
+class templates(IBrowserRequest):
+    """Layer to store all templates."""
+
+class images(IBrowserRequest):
+    """Layer to store all images."""
+
+class css(IBrowserRequest):
+    """Layer to store all stylesheets."""
+
+class ZopeTop(templates, images, css, rotterdam):
+    """The `ZopeTop`.
+
+    This skin consists of its three specific layers plus the rotterdam layer.
+    """
+

Modified: Zope3/trunk/src/zope/app/zopetop/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/zopetop/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -2,10 +2,7 @@
   xmlns:zope="http://namespaces.zope.org/zope"
   xmlns="http://namespaces.zope.org/browser">
 
-  <layer name="templates" />
-  <layer name="images" />
-  <layer name="css" />
-  <skin name="ZopeTop" layers="templates images css rotterdam default" />
+  <skin interface="zope.app.zopetop.ZopeTop" />
 
   <page
       for="*"
@@ -13,108 +10,108 @@
       permission="zope.View"
       class=".standardmacros.StandardMacros"
       allowed_interface="zope.interface.common.mapping.IItemMapping"
-      layer="templates" />
+      layer="zope.app.zopetop.templates" />
 
   <page
       for="*"
       name="view_macros"
       permission="zope.View"
       template="view_macros.pt"
-      layer="templates" />
+      layer="zope.app.zopetop.templates" />
 
   <page
       for="*"
       name="widget_macros"
       permission="zope.View"
       template="widget_macros.pt"
-      layer="templates" />
+      layer="zope.app.zopetop.templates" />
 
   <page
       for="*"
       name="dialog_macros"
       permission="zope.View"
       template="dialog_macros.pt"
-      layer="templates" />
+      layer="zope.app.zopetop.templates" />
 
   <resource name="pdlib.js" file="pdlib.js"
-            layer="templates" />
+            layer="zope.app.zopetop.templates" />
 
   <resource name="zopetop.css" file="zopetop.css"
-            layer="css" />
+            layer="zope.app.zopetop.css" />
 
   <resource name="service_manager.gif" file="service_manager.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="arrowup.gif" file="arrowup.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="zope3logo.jpg" file="zope3logo.jpg"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="bg_top.jpg" file="bg_top.jpg"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="bg_bar.jpg" file="bg_bar.jpg"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="closed_folder.gif" file="closed_folder.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="spacer1.gif" file="spacer1.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="spacer2.gif" file="spacer2.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="spacer3.gif" file="spacer3.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="x.gif" file="x.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="new_file.gif" file="new_file.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="new_folder.gif" file="new_folder.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="new_template.gif" file="new_template.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="control_panels.gif" file="control_panels.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="system_security.gif" file="system_security.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="user_accounts.gif" file="user_accounts.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="control_panels_folder.gif" file="control_panels_folder.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="add_more.gif" file="add_more.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="bg_root_folder.jpg" file="bg_root_folder.jpg"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="plus.gif" file="plus.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="minus.gif" file="minus.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="users_folder.gif" file="users_folder.gif"
-            layer="images" />
+            layer="zope.app.zopetop.images" />
 
   <resource name="website_settings.gif" file="website_settings.gif"
-            layer="images"/>
+            layer="zope.app.zopetop.images"/>
 
   <resource name="bg_content.jpg" file="bg_content.jpg"
-            layer="images"/>
+            layer="zope.app.zopetop.images"/>
 
   <resource name="help.gif" file="help.gif"
-            layer="images"/>
+            layer="zope.app.zopetop.images"/>
 
 </zope:configure>

Added: Zope3/trunk/src/zope/app/zopetop/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/zopetop/ftests.py	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zope/app/zopetop/ftests.py	2004-09-17 22:31:32 UTC (rev 27629)
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# Copyright (c) 2004 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.
+#
+##############################################################################
+"""Functional Tests for `ZopeTop` skin.
+
+$Id: test_templatedpage.py,v 1.1.1.1 2004/02/18 18:07:08 srichter Exp $
+"""
+__docformat__ = 'restructuredtext'
+import unittest
+
+from zope.app.tests.functional import BrowserTestCase
+
+class ZopeTopSkinTests(BrowserTestCase):
+    """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')
+        self.assert_(response1.getBody() != response2.getBody())
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(ZopeTopSkinTests),
+        ))
+
+if __name__=='__main__':
+    unittest.main(defaultTest='test_suite')

Modified: Zope3/trunk/src/zwiki/browser/skin/configure.zcml
===================================================================
--- Zope3/trunk/src/zwiki/browser/skin/configure.zcml	2004-09-17 21:39:28 UTC (rev 27628)
+++ Zope3/trunk/src/zwiki/browser/skin/configure.zcml	2004-09-17 22:31:32 UTC (rev 27629)
@@ -4,7 +4,7 @@
     i18n_domain="zope"
     >
 <browser:layer name="wiki" />
-<browser:skin name="wiki" layers="wiki rotterdam default" />
+<browser:skin name="wiki" layers="wiki zope.app.rotterdam.rotterdam " />
 
 <browser:resource 
     name="wiki.css" file="wiki.css" layer="wiki" />



More information about the Zope3-Checkins mailing list