[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/ Backed out rev27060, I will try to merge the revisions one by one. Also

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 12 14:53:55 EDT 2004


Log message for revision 27074:
  Backed out rev27060, I will try to merge the revisions one by one. Also 
  merged in 27037, since it fixed the last failure.
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/component/configure.zcml
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/component/hooks.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_servicedirective.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/meta.zcml
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/browser/tests/test_directives.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/securitypolicy/browser/ftests.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/component/__init__.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/component/interfaces.py
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/backward.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/configuration/config.py
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/meta.zcml
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/metaconfigure.py
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backward.zcml
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkw.zcml
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkwextra.zcml
  A   Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/test_backward.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/component/configure.zcml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/component/configure.zcml	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/component/configure.zcml	2004-08-12 18:53:54 UTC (rev 27074)
@@ -32,6 +32,21 @@
       factory="zope.app.utility.vocabulary.UtilityVocabulary"
       interface="zope.interface.interfaces.IInterface" />
 
+  <hook
+      module="zope.component"
+      name="getServices"
+      implementation="zope.app.component.hooks.getServices_hook" />
+
+  <hook
+      module="zope.component"
+      name="adapter_hook"
+      implementation="zope.app.component.hooks.adapter_hook" />
+
+  <hook
+      module="zope.component"
+      name="queryView"
+      implementation="zope.app.component.hooks.queryView" />
+
   <interface interface="zope.interface.Interface" />
 
   <adapter

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/component/hooks.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/component/hooks.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/component/hooks.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -15,7 +15,6 @@
 
 $Id$
 """
-import zope.component
 from zope.component import getService
 from zope.component.interfaces import IServiceService
 from zope.app.site.interfaces import ISite
@@ -87,18 +86,11 @@
     except ComponentLookupError:
         return serviceManager
 
-# Hook up a new implementation of looking up services.
-zope.component.getServices.sethook(getServices_hook)
-
 def adapter_hook(interface, object, name='', default=None):
     try:
         return siteinfo.adapter_hook(interface, object, name, default)
     except ComponentLookupError:
         return default
-
-# Hook up a new implementation of looking up adapters.
-zope.component.adapter_hook.sethook(adapter_hook)
-
     
 def queryView(object, name, request, default=None,
               providing=Interface, context=None):
@@ -109,6 +101,3 @@
         locate(view, object, name)
 
     return view
-
-# Hook up a new implementation of looking up views.
-zope.component.queryView.sethook(queryView)

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_servicedirective.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_servicedirective.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_servicedirective.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -60,12 +60,13 @@
             UndefinedService,
             xmlconfig,
             StringIO(template % (
-            '''
+            """
             <service
-                serviceType="Foo"
-                component="zope.app.component.tests.service.fooService"
-                />
-            '''
+              serviceType="Foo"
+              component="
+              zope.app.component.tests.service.fooService"
+              />
+            """
             )))
 
     def testDuplicateServiceConfig(self):
@@ -73,36 +74,39 @@
             ConfigurationConflictError,
             xmlconfig,
             StringIO(template % (
-            '''
-            <serviceType
-                id="Foo"
-                interface="zope.app.component.tests.service.IFooService"
-                />
+            """
+            <serviceType id="Foo"
+                         interface="
+               zope.app.component.tests.service.IFooService"
+               />
             <service
               serviceType="Foo"
-              component="zope.app.component.tests.service.fooService"
+              component="
+              zope.app.component.tests.service.fooService"
               />
             <service
               serviceType="Foo"
-              component="zope.app.component.tests.service.foo2"
+              component="
+              zope.app.component.tests.service.foo2"
               />
-            '''
+            """
             )))
 
     def testServiceConfig(self):
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            '''
-            <serviceType
-                id="Foo"
-                interface="zope.app.component.tests.service.IFooService"
-                />
+            """
+            <serviceType id="Foo"
+                         interface="
+               zope.app.component.tests.service.IFooService"
+               />
             <service
-                serviceType="Foo"
-                component="zope.app.component.tests.service.fooService"
-                />
-            '''
+              serviceType="Foo"
+              component="
+              zope.app.component.tests.service.fooService"
+              />
+            """
             )))
 
         service = getService("Foo")
@@ -114,16 +118,17 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            '''
-            <serviceType
-                id="Foo"
-                interface="zope.app.component.tests.service.IFooService"
-                />
+            """
+            <serviceType id="Foo"
+                         interface="
+               zope.app.component.tests.service.IFooService"
+               />
             <service
-                serviceType="Foo"
-                factory="zope.app.component.tests.service.FooService"
-                />
-            '''
+              serviceType="Foo"
+              factory="
+              zope.app.component.tests.service.FooService"
+              />
+            """
             )))
 
         service = getService("Foo")
@@ -135,17 +140,18 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            '''
-            <serviceType
-                id="Foo"
-                interface="zope.app.component.tests.service.IFooService"
-                />
+            """
+            <serviceType id="Foo"
+                         interface="
+               zope.app.component.tests.service.IFooService"
+               />
             <service
-                serviceType="Foo"
-                component="zope.app.component.tests.service.fooService"
-                permission="zope.Public"
-                />
-            '''
+              serviceType="Foo"
+              component="
+              zope.app.component.tests.service.fooService"
+              permission="zope.Public"
+              />
+            """
             )))
 
         service = getService("Foo")
@@ -158,23 +164,30 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            '''
-            <include package="zope.app.security" file="meta.zcml" />
+            """
+            <directives namespace="http://namespaces.zope.org/zope">
+              <directive name="permission"
+                 attributes="id title description"
+                 handler="
+              zope.app.security.metaconfigure.definePermission" />
+            </directives>
 
             <permission id="zope.TestPermission" title="Test permission" />
 
-            <serviceType
-                id="Foo"
-                interface="zope.app.component.tests.service.IFooService"
-                />
+            <serviceType id="Foo"
+                         interface="
+               zope.app.component.tests.service.IFooService"
+               />
             <service
-                serviceType="Foo"
-                component="zope.app.component.tests.service.fooService"
-                permission="zope.TestPermission"
-                />
-            '''
+              serviceType="Foo"
+              component="
+              zope.app.component.tests.service.fooService"
+              permission="zope.TestPermission"
+              />
+            """
             )))
 
+
         # Need to "log someone in" to turn on checks
         from zope.security.management import newInteraction, endInteraction
         endInteraction()

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/meta.zcml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/meta.zcml	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/meta.zcml	2004-08-12 18:53:54 UTC (rev 27074)
@@ -2,6 +2,7 @@
 
 <!-- Standard configuration directives -->
 <include package="zope.modulealias" file="meta.zcml" />
+<include package="zope.configuration" file="meta.zcml" />
 
 <include package="zope.app.component" file="meta.zcml" />
 <include package="zope.app.publisher" file="meta.zcml" />

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/browser/tests/test_directives.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/browser/tests/test_directives.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/browser/tests/test_directives.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+
 import os
 import unittest
 from cStringIO import StringIO
@@ -110,15 +111,14 @@
                          None)
 
         xmlconfig(StringIO(template % (
-            '''
-            <browser:page
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                />
-            '''
+            """
+            <browser:page name="test"
+                          class="zope.app.component.tests.views.V1"
+                          for="zope.app.component.tests.views.IC"
+                          permission="zope.Public"
+                          attribute="index"
+                          />
+            """
             )))
 
         v = queryView(ob, 'test', request)
@@ -131,19 +131,17 @@
                          
 
         xmlconfig(StringIO(template % (
-            '''
-            <browser:menu
-                id="test_menu" title="Test menu" />
-            <browser:page
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                template="%s" 
-                menu="test_menu"
-                title="Test View"
-                />
-            ''' % testtemplate
+            """
+            <browser:menu id="test_menu" title="Test menu" />
+            <browser:page name="test"
+                          class="zope.app.component.tests.views.V1"
+                          for="zope.app.component.tests.views.IC"
+                          permission="zope.Public"
+                          template="%s" 
+                          menu="test_menu"
+                          title="Test View"
+                          />
+            """ % testtemplate
             )))
 
         menuItem = globalBrowserMenuService.getFirstMenuItem(
@@ -160,18 +158,16 @@
         testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
                          
         xmlconfig(StringIO(template % (
-            '''
-            <browser:menu
-                id="test_menu" title="Test menu"/>
-            <browser:page
-                name="test"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                template="%s" 
-                menu="test_menu"
-                title="Test View"
-                />
-            ''' % testtemplate
+            """
+            <browser:menu id="test_menu" title="Test menu"/>
+            <browser:page name="test"
+                          for="zope.app.component.tests.views.IC"
+                          permission="zope.Public"
+                          template="%s" 
+                          menu="test_menu"
+                          title="Test View"
+                          />
+            """ % testtemplate
             )))
 
         menuItem = globalBrowserMenuService.getFirstMenuItem(
@@ -188,20 +184,17 @@
         testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
 
         xmlconfig(StringIO(template % (
-            '''
-            <browser:menu
-                id="test_menu" title="Test menu" />
-            <browser:pages
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public">
-              <browser:page
-                  name="test"
-                  template="%s" 
-                  menu="test_menu"
-                  title="Test View"
-                  />
+            """
+            <browser:menu id="test_menu" title="Test menu" />
+            <browser:pages for="zope.app.component.tests.views.IC"
+                          permission="zope.Public">
+                <browser:page name="test"
+                              template="%s" 
+                              menu="test_menu"
+                              title="Test View"
+                              />
             </browser:pages>                  
-            ''' % testtemplate
+            """ % testtemplate
             )))
 
         menuItem = globalBrowserMenuService.getFirstMenuItem(
@@ -219,21 +212,18 @@
                          
 
         xmlconfig(StringIO(template % (
-            '''
-            <browser:menu
-                id="test_menu" title="Test menu" />
-            <browser:pages
-                for="zope.app.component.tests.views.IC"
-                class="zope.app.component.tests.views.V1"
-                permission="zope.Public">
-              <browser:page
-                  name="test"
-                  template="%s" 
-                  menu="test_menu"
-                  title="Test View"
-                  />
+            """
+            <browser:menu id="test_menu" title="Test menu" />
+            <browser:pages for="zope.app.component.tests.views.IC"
+                           class="zope.app.component.tests.views.V1"
+                           permission="zope.Public">
+                <browser:page name="test"
+                              template="%s" 
+                              menu="test_menu"
+                              title="Test View"
+                              />
             </browser:pages>                  
-            ''' % testtemplate
+            """ % testtemplate
             )))
 
         menuItem = globalBrowserMenuService.getFirstMenuItem(
@@ -248,11 +238,10 @@
                                    None), None)
 
         xmlconfig(StringIO(template % (
-            '''
-            <browser:defaultView
-                name="test"
-                for="zope.app.component.tests.views.IC" />
-            '''
+            """
+            <browser:defaultView name="test"
+                                 for="zope.app.component.tests.views.IC" />
+            """
             )))
 
         self.assertEqual(getDefaultViewName(ob, request
@@ -267,12 +256,12 @@
             <browser:layer name="zmi" />
             <browser:skin name="zmi" layers="zmi default" />
             <browser:resource
-                name="test"
-                factory="zope.app.component.tests.views.RZMI"
-                layer="zmi" />
+                  name="test"
+                  factory="zope.app.component.tests.views.RZMI"
+                  layer="zmi" />
             <browser:resource
-                name="test"
-                factory="zope.app.component.tests.views.R1" />
+                  name="test"
+                  factory="zope.app.component.tests.views.R1" />
             '''
             )))
 
@@ -290,18 +279,18 @@
             <browser:skin name="zmi" layers="zmi default" />
             <browser:defaultSkin name="zmi" />
             <browser:page name="test"
-                class="zope.app.component.tests.views.VZMI"
-                layer="zmi"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                />
+                  class="zope.app.component.tests.views.VZMI"
+                  layer="zmi"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  attribute="index"
+                  />
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                />
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  attribute="index"
+                  />
             '''
             )))
         v = queryView(ob, 'test', TestRequest(skin=''))
@@ -311,23 +300,23 @@
         self.assertEqual(queryView(ob, 'test', request, None), None)
 
         xmlconfig(StringIO(template % (
-            '''
+            """
             <browser:layer name="zmi" />
             <browser:skin name="zmi" layers="zmi default" />
             <browser:page name="test"
-                class="zope.app.component.tests.views.VZMI"
-                layer="zmi"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                />
+                  class="zope.app.component.tests.views.VZMI"
+                  layer="zmi"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  attribute="index"
+                  />
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  attribute="index"
+                  />
+            """
             )))
 
         v = queryView(ob, 'test', request)
@@ -342,12 +331,12 @@
         path2 = os.path.join(tests_path, 'testfiles', 'test2.pt')
 
         xmlconfig(StringIO(template % (
-            '''
+            """
             <browser:i18n-resource name="test" defaultLanguage="fr">
               <browser:translation language="en" file="%s" />
               <browser:translation language="fr" file="%s" />
             </browser:i18n-resource>
-            ''' % (path1, path2)
+            """ % (path1, path2)
             )))
 
         v = getResource('test', request)
@@ -359,37 +348,37 @@
 
         # translation must be provided for the default language
         config = StringIO(template % (
-            '''
+            """
             <browser:i18n-resource name="test" defaultLanguage="fr">
               <browser:translation language="en" file="%s" />
               <browser:translation language="lt" file="%s" />
             </browser:i18n-resource>
-            ''' % (path1, path2)
+            """ % (path1, path2)
             ))
         self.assertRaises(ConfigurationError, xmlconfig, config)
 
         # files and images can't be mixed
         config = StringIO(template % (
-            '''
+            """
             <browser:i18n-resource name="test" defaultLanguage="fr">
               <browser:translation language="en" file="%s" />
               <browser:translation language="fr" image="%s" />
             </browser:i18n-resource>
-            ''' % (path1, path2)
+            """ % (path1, path2)
             ))
         self.assertRaises(ConfigurationError, xmlconfig, config)
 
     def testInterfaceProtectedPage(self):
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                attribute="index"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                allowed_interface="zope.app.component.tests.views.IV"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  attribute="index"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+              allowed_interface="zope.app.component.tests.views.IV"
+                  />
+            """
             ))
 
         v = getView(ob, 'test', request)
@@ -399,15 +388,15 @@
 
     def testAttributeProtectedPage(self):
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                attribute="action"
-                permission="zope.Public"
-                allowed_attributes="action"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  attribute="action"
+                  permission="zope.Public"
+                  allowed_attributes="action"
+                  />
+            """
             ))
 
         v = getView(ob, 'test', request)
@@ -417,16 +406,16 @@
 
     def testInterfaceAndAttributeProtectedPage(self):
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                attribute="index"
-                allowed_attributes="action"
-                allowed_interface="zope.app.component.tests.views.IV"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  attribute="index"
+                  allowed_attributes="action"
+                  allowed_interface="zope.app.component.tests.views.IV"
+                  />
+            """
             ))
 
         v = getView(ob, 'test', request)
@@ -435,16 +424,16 @@
 
     def testDuplicatedInterfaceAndAttributeProtectedPage(self):
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                attribute="index"
-                permission="zope.Public"
-                allowed_attributes="action index"
-                allowed_interface="zope.app.component.tests.views.IV"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  attribute="index"
+                  permission="zope.Public"
+                  allowed_attributes="action index"
+                  allowed_interface="zope.app.component.tests.views.IV"
+                  />
+            """
             ))
 
         v = getView(ob, 'test', request)
@@ -453,16 +442,16 @@
 
     def test_class_w_implements(self):
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page
-                name="test"
-                class="
+                  name="test"
+                  class="
              zope.app.publisher.browser.tests.test_directives.C_w_implements"
-                for="zope.app.component.tests.views.IC"
-                attribute="index"
-                permission="zope.Public"
-                />
-            '''
+                  for="zope.app.component.tests.views.IC"
+                  attribute="index"
+                  permission="zope.Public"
+                  />
+            """
             ))
 
         v = getView(ob, 'test', request)
@@ -474,14 +463,14 @@
             ConfigurationError,
             xmlconfig,
             StringIO(template %
-            '''
+            """
             <browser:page name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                attribute="index"
-                allowed_attributes="action index"
-                />
-            '''
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  attribute="index"
+                  allowed_attributes="action index"
+                  />
+            """
             ))
 
 
@@ -490,18 +479,18 @@
         test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:pages
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
 
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
-              <browser:page name="test.html" template="%s" />
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
+                <browser:page name="test.html" template="%s" />
             </browser:pages>
-            ''' % test3
+            """ % test3
             ))
 
         v = getView(ob, 'index.html', request)
@@ -515,18 +504,18 @@
         self.assertEqual(queryView(ob, 'test', request), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.publisher.browser.tests.test_directives.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
+                  name="test"
+                  class="zope.app.publisher.browser.tests.test_directives.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
 
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
             </browser:view>
-            '''
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -546,14 +535,14 @@
         self.assertEqual(queryView(ob, 'test', request), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.publisher.browser.tests.test_directives.CV"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                />
-            '''
+                  name="test"
+                  class="zope.app.publisher.browser.tests.test_directives.CV"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  />
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -564,14 +553,14 @@
         self.assertEqual(queryView(ob, 'test', request), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.publisher.browser.tests.test_directives.NCV"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                />
-            '''
+                  name="test"
+                  class="zope.app.publisher.browser.tests.test_directives.NCV"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  />
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -583,19 +572,19 @@
         test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
+                  name="test"
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
 
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
-              <browser:page name="test.html" template="%s" />
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
+                <browser:page name="test.html" template="%s" />
             </browser:view>
-            ''' % test3
+            """ % test3
             ))
 
         view = getView(ob, 'test', request)
@@ -618,20 +607,20 @@
         test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
-            
-              <browser:defaultPage name="test.html" />
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
-              <browser:page name="test.html" template="%s" />
+                  name="test"
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
+
+                <browser:defaultPage name="test.html" />
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
+                <browser:page name="test.html" template="%s" />
             </browser:view>
-            ''' % test3
+            """ % test3
             ))
 
         view = getView(ob, 'test', request)
@@ -653,18 +642,18 @@
         """Tests proper traversal of a page defined for a view."""
         
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public" />
+                  name="test"
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public" />
 
             <browser:page name="index.html"
                 for="zope.app.component.tests.views.IV" 
                 class="zope.app.publisher.browser.tests.test_directives.CV"
                 permission="zope.Public" />
-            '''
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -680,18 +669,18 @@
         case.
         """
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
-                name="test"
-                class="zope.app.publisher.browser.tests.test_directives.VT"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public" />
+                  name="test"
+                  class="zope.app.publisher.browser.tests.test_directives.VT"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public" />
 
             <browser:page name="index.html"
                 for="zope.app.component.tests.views.IV" 
                 class="zope.app.publisher.browser.tests.test_directives.CV"
                 permission="zope.Public" />
-            '''
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -706,21 +695,26 @@
                          None)
 
         xmlconfig(StringIO(template %
-            '''
-            <include package="zope.app.security" file="meta.zcml" />
-            
+            """
+            <directives namespace="http://namespaces.zope.org/zope">
+              <directive name="permission"
+                 attributes="id title description"
+                 handler="
+             zope.app.security.metaconfigure.definePermission" />
+            </directives>
+
             <permission id="zope.TestPermission" title="Test permission" />
 
             <browser:pages
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.TestPermission"
-                >
-             
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.TestPermission"
+                  >
+
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
             </browser:pages>
-            '''
+            """
             ))
 
         v = getView(ob, 'index.html', request)
@@ -736,22 +730,27 @@
                          None)
 
         xmlconfig(StringIO(template %
-            '''
-            <include package="zope.app.security" file="meta.zcml" />
+            """
+            <directives namespace="http://namespaces.zope.org/zope">
+              <directive name="permission"
+                 attributes="id title description"
+                 handler="
+             zope.app.security.metaconfigure.definePermission" />
+            </directives>
 
             <permission id="zope.TestPermission" title="Test permission" />
 
             <browser:view
-                name="test"
-                class="zope.app.component.tests.views.V1"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
-             
-              <browser:page name="index.html" attribute="index" />
-              <browser:page name="action.html" attribute="action" />
+                  name="test"
+                  class="zope.app.component.tests.views.V1"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
+
+                <browser:page name="index.html" attribute="index" />
+                <browser:page name="action.html" attribute="action" />
             </browser:view>
-            '''
+            """
             ))
 
         view = getView(ob, 'test', request)
@@ -764,27 +763,27 @@
         self.assertEqual(queryView(ob, 'test', request), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:layer name="layer" />
             <browser:skin name="skinny" layers="layer default" />
             <browser:pages
-                for="*"
-                class="zope.app.component.tests.views.V1"
-                permission="zope.Public"
-                >
-             
-              <browser:page name="index.html" attribute="index" />
+                  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"
-                permission="zope.Public"
-                >
-            
-              <browser:page name="index.html" attribute="action" />
+                  for="*"
+                  class="zope.app.component.tests.views.V1"
+                  layer="layer"
+                  permission="zope.Public"
+                  >
+
+                <browser:page name="index.html" attribute="action" />
             </browser:pages>
-            '''
+            """
             ))
 
         v = getView(ob, 'index.html', request)
@@ -798,12 +797,12 @@
         self.assertEqual(queryResource('test', request), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:resource
-                name="index.html"
-                file="%s"
-                />
-            ''' % path
+                  name="index.html"
+                  file="%s"
+                  />
+            """ % path
             ))
 
         r = ProxyFactory(getResource('index.html', request))
@@ -828,12 +827,12 @@
         path = os.path.join(tests_path, 'testfiles', 'test.pt')
 
         xmlconfig(StringIO(template % (
-            '''
+            """
             <browser:layer name="zmi" />
             <browser:skin name="zmi" layers="zmi default" />
             <browser:resource name="test" file="%s" 
                   layer="zmi" />
-            ''' % path
+            """ % path
             )))
 
         self.assertEqual(queryResource('test', request), None)
@@ -849,13 +848,13 @@
                          None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page
-                name="index.html"
-                template="%s"
-                permission="zope.Public"
-                for="zope.app.component.tests.views.IC" />
-            ''' % path
+                  name="index.html"
+                  template="%s"
+                  permission="zope.Public"
+                  for="zope.app.component.tests.views.IC" />
+            """ % path
             ))
 
         v = getView(ob, 'index.html', request)
@@ -868,14 +867,14 @@
                          None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page
-                name="index.html"
-                template="%s"
-                permission="zope.Public"
+                  name="index.html"
+                  template="%s"
+                  permission="zope.Public"
           class="zope.app.publisher.browser.tests.templateclass.templateclass"
-                for="zope.app.component.tests.views.IC" />
-            ''' % path
+                  for="zope.app.component.tests.views.IC" />
+            """ % path
             ))
 
         v = getView(ob, 'index.html', request)
@@ -890,27 +889,32 @@
                          None)
 
         xmlconfig(StringIO(template %
-            '''
-            <include package="zope.app.security" file="meta.zcml" />
+            """
+            <directives namespace="http://namespaces.zope.org/zope">
+              <directive name="permission"
+                 attributes="id title description"
+                 handler="
+               zope.app.security.metaconfigure.definePermission" />
+            </directives>
 
             <permission id="zope.TestPermission" title="Test permission" />
 
             <browser:page
-                name="xxx.html"
-                template="%s"
-                permission="zope.TestPermission"
-                for="zope.app.component.tests.views.IC" />
-            ''' % path
+                  name="xxx.html"
+                  template="%s"
+                  permission="zope.TestPermission"
+                  for="zope.app.component.tests.views.IC" />
+            """ % path
             ))
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:page
-                name="index.html"
-                template="%s"
-                permission="zope.Public"
-                for="zope.app.component.tests.views.IC" />
-            ''' % path
+                  name="index.html"
+                  template="%s"
+                  permission="zope.Public"
+                  for="zope.app.component.tests.views.IC" />
+            """ % path
             ))
 
         v = getView(ob, 'xxx.html', request)
@@ -929,12 +933,12 @@
             ConfigurationError,
             xmlconfig,
             StringIO(template %
-            '''
+            """
             <browser:page
-                template="%s"
-                for="zope.app.component.tests.views.IC"
-                />
-            ''' % path
+                  template="%s"
+                  for="zope.app.component.tests.views.IC"
+                  />
+            """ % path
             ))
 
     def testtemplateAndPage(self):
@@ -943,16 +947,16 @@
             ConfigurationError,
             xmlconfig,
             StringIO(template %
-            '''
+            """
             <browser:view
-                name="index.html"
-                template="%s"
-                for="zope.app.component.tests.views.IC"
-                permission="zope.Public"
-                >
-              <browser:page name="foo.html" attribute="index" />
+                  name="index.html"
+                  template="%s"
+                  for="zope.app.component.tests.views.IC"
+                  permission="zope.Public"
+                  >
+               <browser:page name="foo.html" attribute="index" />
             </browser:view>
-            ''' % path
+            """ % path
             ))
 
     def testViewThatProvidesAnInterface(self):
@@ -960,21 +964,21 @@
         self.assertEqual(queryView(ob, 'test', request, None), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
                 name="test"
                 class="zope.app.component.tests.views.V1"
                 for="zope.app.component.tests.views.IC"
                 permission="zope.Public"
                 />
-            '''
+            """
             ))
 
         v = queryView(ob, 'test', request, None, providing=IV)
         self.assertEqual(v, None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
                 name="test"
                 class="zope.app.component.tests.views.V1"
@@ -982,7 +986,7 @@
                 provides="zope.app.component.tests.views.IV"
                 permission="zope.Public"
                 />
-            '''
+            """
             ))
 
         v = queryView(ob, 'test', request, None, providing=IV)
@@ -994,27 +998,27 @@
         self.assertEqual(queryView(ob, '', request, None, providing=IV), None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
                 class="zope.app.component.tests.views.V1"
                 for="zope.app.component.tests.views.IC"
                 permission="zope.Public"
                 />
-            '''
+            """
             ))
 
         v = queryView(ob, '', request, None, providing=IV)
         self.assertEqual(v, None)
 
         xmlconfig(StringIO(template %
-            '''
+            """
             <browser:view
                 class="zope.app.component.tests.views.V1"
                 for="zope.app.component.tests.views.IC"
                 provides="zope.app.component.tests.views.IV"
                 permission="zope.Public"
                 />
-            '''
+            """
             ))
 
         v = queryView(ob, '', request, None, providing=IV)

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/securitypolicy/browser/ftests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/securitypolicy/browser/ftests.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/securitypolicy/browser/ftests.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -81,7 +81,9 @@
             basic='mgr:mgrpw')
         self.assertEqual(response.getStatus(), 200)
         body = response.getBody()
-        self.assert_('Permissions assigned to the role' in body)
+        self.assert_(
+            'This page shows the permissions allowed and denied the role'
+            in body)
         self.assert_('Allow' in body)
         self.assert_('Deny' in body)
         self.checkForBrokenLinks(body, '/@@RolesPermissions.html',

Modified: Zope3/branches/ZopeX3-3.0/src/zope/component/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/component/__init__.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/component/__init__.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -261,4 +261,4 @@
 def queryResource(name, request, default=None, providing=Interface,
                   context=None):
     s = getService(Presentation, context)
-    return s.queryResource(name, request, default=default, providing=providing)
+    return s.queryResource(name, request, default, providing=providing)

Modified: Zope3/branches/ZopeX3-3.0/src/zope/component/interfaces.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/component/interfaces.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/component/interfaces.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -552,7 +552,7 @@
 class IPresentationService(Interface):
     """A service to manage Presentation components."""
 
-    def queryResource(name, request, default=None, providing=Interface):
+    def queryResource(name, request, providing=Interface, default=None):
         """Look up a named resource for a given request
 
         The request must implement IPresentationRequest.
@@ -560,7 +560,7 @@
         The default will be returned if the component can't be found.
         """
 
-    def queryView(object, name, request, default=None, providing=Interface):
+    def queryView(object, name, request, providing=Interface, default=None):
         """Look for a named view for a given object and request
 
         The request must implement IPresentationRequest.

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/backward.py (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/backward.py)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/backward.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.6
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: Zope3/branches/ZopeX3-3.0/src/zope/configuration/config.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/configuration/config.py	2004-08-12 18:25:42 UTC (rev 27073)
+++ Zope3/branches/ZopeX3-3.0/src/zope/configuration/config.py	2004-08-12 18:53:54 UTC (rev 27074)
@@ -1568,3 +1568,6 @@
             handler="zope.configuration.config.subdirective",
             schema="zope.configuration.config.IDirectiveInfo"
             )
+
+    import zope.configuration.backward
+    zope.configuration.backward.bootstrap(context)

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/meta.zcml (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/meta.zcml)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/meta.zcml
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.4
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/metaconfigure.py (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/metaconfigure.py)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/metaconfigure.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.4
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backward.zcml (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backward.zcml)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backward.zcml
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.1
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkw.zcml (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkw.zcml)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkw.zcml
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.1
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkwextra.zcml (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkwextra.zcml)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/backwardkwextra.zcml
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.1
Name: svn:eol-style
   + native

Copied: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/test_backward.py (from rev 27060, Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/test_backward.py)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/configuration/tests/test_backward.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
   + 1.3
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list