[Checkins] SVN: z3c.hashedresource/trunk/ Add compatibility for zope2.

Sebastian Wehrmann sw at gocept.com
Mon Jul 13 10:00:29 EDT 2009


Log message for revision 101850:
  Add compatibility for zope2.
  

Changed:
  U   z3c.hashedresource/trunk/CHANGES.txt
  U   z3c.hashedresource/trunk/buildout.cfg
  U   z3c.hashedresource/trunk/setup.py
  U   z3c.hashedresource/trunk/src/z3c/hashedresource/README.txt
  U   z3c.hashedresource/trunk/src/z3c/hashedresource/url.py

-=-
Modified: z3c.hashedresource/trunk/CHANGES.txt
===================================================================
--- z3c.hashedresource/trunk/CHANGES.txt	2009-07-13 13:58:11 UTC (rev 101849)
+++ z3c.hashedresource/trunk/CHANGES.txt	2009-07-13 14:00:28 UTC (rev 101850)
@@ -5,7 +5,8 @@
 1.1 (unreleased)
 ================
 
-- Nothing changed yet.
+- Added compatibility with Zope2. The dependency on zope.app.publisher >= 3.8.2
+  is not longer declared explicitly, but still required when using Zope3.
 
 
 1.0 (2009-06-16)

Modified: z3c.hashedresource/trunk/buildout.cfg
===================================================================
--- z3c.hashedresource/trunk/buildout.cfg	2009-07-13 13:58:11 UTC (rev 101849)
+++ z3c.hashedresource/trunk/buildout.cfg	2009-07-13 14:00:28 UTC (rev 101850)
@@ -1,6 +1,5 @@
 [buildout]
 develop = .
-          ../zope.app.publisher
 parts = test
 
 [test]

Modified: z3c.hashedresource/trunk/setup.py
===================================================================
--- z3c.hashedresource/trunk/setup.py	2009-07-13 13:58:11 UTC (rev 101849)
+++ z3c.hashedresource/trunk/setup.py	2009-07-13 14:00:28 UTC (rev 101850)
@@ -26,17 +26,19 @@
     install_requires=[
         'setuptools',
         'z3c.noop',
-        'zope.app.publisher>=3.8.2',
+        # When using Zope3, we need zope.app.publisher>=3.8.2.
+        'zope.app.publisher',
         'zope.component',
         'zope.interface',
         'zope.publisher',
         ],
-    extras_require=dict(test=[
-        'zope.app.testing',
-        'zope.app.zcmlfiles',
-        'zope.security',
-        'zope.site',
-        'zope.testbrowser',
+    extras_require=dict(
+        test=[
+            'zope.app.testing',
+            'zope.app.zcmlfiles',
+            'zope.security',
+            'zope.site',
+            'zope.testbrowser',
         ]),
     include_package_data = True,
     zip_safe = False,

Modified: z3c.hashedresource/trunk/src/z3c/hashedresource/README.txt
===================================================================
--- z3c.hashedresource/trunk/src/z3c/hashedresource/README.txt	2009-07-13 13:58:11 UTC (rev 101849)
+++ z3c.hashedresource/trunk/src/z3c/hashedresource/README.txt	2009-07-13 14:00:28 UTC (rev 101850)
@@ -20,4 +20,8 @@
 
 To use this package, include its configure.zcml and use
 `z3c.hashedresource.interfaces.IHashedResourceSkin` or a skin that inherits from
-it.
\ No newline at end of file
+it.
+
+The dependency on zope.app.publisher >= 3.8.2 is not longer declared
+explicitly in order to gain compatibility with Zope2, but it is still required
+when using Zope3.

Modified: z3c.hashedresource/trunk/src/z3c/hashedresource/url.py
===================================================================
--- z3c.hashedresource/trunk/src/z3c/hashedresource/url.py	2009-07-13 13:58:11 UTC (rev 101849)
+++ z3c.hashedresource/trunk/src/z3c/hashedresource/url.py	2009-07-13 14:00:28 UTC (rev 101850)
@@ -17,9 +17,12 @@
 from zope.interface import implements, implementsOnly, directlyProvides
 from zope.traversing.browser.interfaces import IAbsoluteURL
 import zope.app.publisher.browser.resource
-import zope.app.publisher.interfaces
 import zope.publisher.interfaces.browser
 import zope.traversing.browser.absoluteurl
+try:
+    from zope.app.publisher.interfaces import IResource
+except ImportError:
+    from zope.component.interfaces import IResource
 
 
 class HashingURL(zope.traversing.browser.absoluteurl.AbsoluteURL):
@@ -29,8 +32,7 @@
     """
 
     implementsOnly(IAbsoluteURL)
-    adapts(zope.app.publisher.interfaces.IResource,
-           interfaces.IHashedResourceSkin)
+    adapts(IResource, interfaces.IHashedResourceSkin)
 
     def __init__(self, context, request):
         self.context = context



More information about the Checkins mailing list