[Checkins] SVN: z3c.soap/trunk/ add zope2.12 support

Jean-Francois Roche jfroche at jfroche.be
Wed May 5 13:07:54 EDT 2010


Log message for revision 111985:
  add zope2.12 support

Changed:
  U   z3c.soap/trunk/docs/HISTORY.txt
  U   z3c.soap/trunk/setup.py
  U   z3c.soap/trunk/z3c/soap/ftests.py
  U   z3c.soap/trunk/z3c/soap/interfaces.py
  U   z3c.soap/trunk/z3c/soap/metaconfigure.py
  A   z3c.soap/trunk/z3c/soap/tests/soap212.zcml
  U   z3c.soap/trunk/z3c/soap/tests/test_directives.py

-=-
Modified: z3c.soap/trunk/docs/HISTORY.txt
===================================================================
--- z3c.soap/trunk/docs/HISTORY.txt	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/docs/HISTORY.txt	2010-05-05 17:07:54 UTC (rev 111985)
@@ -4,7 +4,7 @@
 0.5.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+* Added Zope 2.12 support (thanks to patch from E. Leddy)
 
 
 0.5.1 (2009-12-07)

Modified: z3c.soap/trunk/setup.py
===================================================================
--- z3c.soap/trunk/setup.py	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/setup.py	2010-05-05 17:07:54 UTC (rev 111985)
@@ -33,8 +33,5 @@
           'setuptools',
           'Products.CMFCore',
           'Products.PluggableAuthService',
-          'ZSI'],
-      entry_points="""
-      # -*- Entry points: -*-
-      """,
-      )
+          'zope.app.folder',
+          'ZSI'])

Modified: z3c.soap/trunk/z3c/soap/ftests.py
===================================================================
--- z3c.soap/trunk/z3c/soap/ftests.py	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/z3c/soap/ftests.py	2010-05-05 17:07:54 UTC (rev 111985)
@@ -21,7 +21,10 @@
 import os
 import zope.interface
 from zope.testing import doctest
-from zope.app.folder.folder import IFolder
+try:
+    from zope.app.folder.folder import IFolder
+except:
+    from zope.site.interfaces import IFolder
 from zope.app.testing.functional import ZCMLLayer
 from zope.app.testing import ztapi
 from z3c.soap.interfaces import ISOAPRequest
@@ -91,8 +94,8 @@
 
 
 def test_suite():
-    #from zope.app.testing.functional import FunctionalDocFileSuite
-    from Testing.ZopeTestCase import FunctionalDocFileSuite
+    from zope.app.testing.functional import FunctionalDocFileSuite
+    #from Testing.ZopeTestCase import FunctionalDocFileSuite
     ftest = FunctionalDocFileSuite(
         'README.txt',
         optionflags=doctest.ELLIPSIS|

Modified: z3c.soap/trunk/z3c/soap/interfaces.py
===================================================================
--- z3c.soap/trunk/z3c/soap/interfaces.py	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/z3c/soap/interfaces.py	2010-05-05 17:07:54 UTC (rev 111985)
@@ -18,7 +18,18 @@
 """
 
 from zope.publisher.interfaces.http import IHTTPRequest, IHTTPResponse
-from zope.component.interfaces import IView, IPresentation
+
+try:
+	from zope.component.interfaces import IView
+except ImportError:
+	from zope.publisher.interfaces import IView
+	
+try:
+	from zope.component.interfaces import IPresentation
+except ImportError:
+	from zope.publisher.interfaces import IView as IPresentation
+	
+
 from zope.publisher.interfaces import IPublishTraverse
 from zope.publisher.interfaces import IPublication
 from zope.interface import Interface
@@ -42,8 +53,7 @@
 class ISOAPResponse(IHTTPResponse):
     """SOAP Response"""
 
-
-class ISOAPPresentation(IPresentation):
+class ISOAPPresentation(IView):
     """SOAP presentation"""
 
 

Modified: z3c.soap/trunk/z3c/soap/metaconfigure.py
===================================================================
--- z3c.soap/trunk/z3c/soap/metaconfigure.py	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/z3c/soap/metaconfigure.py	2010-05-05 17:07:54 UTC (rev 111985)
@@ -24,7 +24,10 @@
 from zope.app.publisher.browser.viewmeta import _handle_for
 
 # XXX handler is non-public.  Should call directives instead
-from zope.app.component.metaconfigure import handler
+try:
+	from zope.app.component.metaconfigure import handler
+except ImportError:
+	from zope.component.zcml import handler
 
 from inspect import ismethod
 from interfaces import ISOAPRequest

Added: z3c.soap/trunk/z3c/soap/tests/soap212.zcml
===================================================================
--- z3c.soap/trunk/z3c/soap/tests/soap212.zcml	                        (rev 0)
+++ z3c.soap/trunk/z3c/soap/tests/soap212.zcml	2010-05-05 17:07:54 UTC (rev 111985)
@@ -0,0 +1,54 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:soap="http://namespaces.zope.org/soap"
+           i18n_domain="zope">
+
+  <include package="z3c.soap" file="meta.zcml"/>
+  <include package="zope.security" file="meta.zcml"/>
+  <include package="z3c.soap" />
+    <soap:view
+      name="test"
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      permission="zope.Public"
+      />
+
+  <soap:view
+      name="test2"
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      permission="zope.Public"
+      interface="zope.component.testfiles.views.IV"
+      />
+
+  <soap:view
+      name="test3"
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      permission="zope.Public"
+      methods="action" />
+
+  <soap:view
+      name="test4"
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      permission="zope.Public"
+      methods="action"
+      interface="zope.component.testfiles.views.IV" />
+
+  <soap:view
+      name="test5"
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      permission="zope.Public"
+      methods="action index"
+      interface="zope.component.testfiles.views.IV" />
+ 
+  <soap:view
+      class="zope.component.testfiles.views.V1"
+      for="zope.component.testfiles.views.IC"
+      interface="zope.component.testfiles.views.IV"
+      methods="action"
+      permission="zope.Public"
+      />
+
+</configure>

Modified: z3c.soap/trunk/z3c/soap/tests/test_directives.py
===================================================================
--- z3c.soap/trunk/z3c/soap/tests/test_directives.py	2010-05-05 16:59:40 UTC (rev 111984)
+++ z3c.soap/trunk/z3c/soap/tests/test_directives.py	2010-05-05 17:07:54 UTC (rev 111985)
@@ -19,7 +19,10 @@
 
 from zope.configuration import xmlconfig
 from zope.configuration.exceptions import ConfigurationError
-from zope.app.component.tests.views import IC
+try:
+	from zope.app.component.tests.views import IC
+except ImportError:
+	from zope.component.testfiles.views import IC
 from zope.component import getMultiAdapter, queryMultiAdapter
 from zope.app.testing.placelesssetup import PlacelessSetup
 from z3c.soap.interfaces import ISOAPRequest
@@ -29,6 +32,12 @@
 import z3c.soap.tests
 from zope.publisher.browser import TestRequest
 
+XMLCONFIG = "soap.zcml"
+try:
+	import zope.app.component.tests.views
+except ImportError:
+	XMLCONFIG = "soap212.zcml"
+	
 request = TestRequest(ISOAPRequest)
 alsoProvides(request, ISOAPRequest)
 
@@ -45,19 +54,19 @@
     def testView(self):
         self.assertEqual(
             queryMultiAdapter((ob, request), name='test'), None)
-        xmlconfig.file("soap.zcml", z3c.soap.tests)
+        xmlconfig.file(XMLCONFIG, z3c.soap.tests)
         self.assertEqual(
             str(queryMultiAdapter((ob, request), name='test').__class__),
             "<class 'Products.Five.metaclass.V1'>")
 
     def testInterfaceAndAttributeProtectedView(self):
-        xmlconfig.file("soap.zcml", z3c.soap.tests)
+        xmlconfig.file(XMLCONFIG, z3c.soap.tests)
         v = getMultiAdapter((ob, request), name='test4')
         self.assertEqual(v.index(), 'V1 here')
         self.assertEqual(v.action(), 'done')
 
     def testDuplicatedInterfaceAndAttributeProtectedView(self):
-        xmlconfig.file("soap.zcml", z3c.soap.tests)
+        xmlconfig.file(XMLCONFIG, z3c.soap.tests)
         v = getMultiAdapter((ob, request), name='test5')
         self.assertEqual(v.index(), 'V1 here')
         self.assertEqual(v.action(), 'done')
@@ -67,7 +76,7 @@
                           "soap_error.zcml", z3c.soap.tests)
 
     def test_no_name(self):
-        xmlconfig.file("soap.zcml", z3c.soap.tests)
+        xmlconfig.file(XMLCONFIG, z3c.soap.tests)
         v = getMultiAdapter((ob, request), name='index')
         self.assertEqual(v(), 'V1 here')
         v = getMultiAdapter((ob, request), name='action')



More information about the checkins mailing list