[Checkins] SVN: zope.dublincore/trunk/ Drop support for Python 2.4 and 2.5.

Tres Seaver cvs-admin at zope.org
Fri May 18 13:55:00 UTC 2012


Log message for revision 126097:
  Drop support for Python 2.4 and 2.5.
  
  Replace deprecated 'zope.component.adapts' usage with equivalent
  'zope.component.adapter' decorator.
  
  Replace deprecated 'zope.interface.implements' usage with equivalent
  'zope.interface.implementer' decorator.
  
  

Changed:
  U   zope.dublincore/trunk/CHANGES.txt
  U   zope.dublincore/trunk/setup.py
  U   zope.dublincore/trunk/src/zope/dublincore/annotatableadapter.py
  U   zope.dublincore/trunk/src/zope/dublincore/property.txt
  U   zope.dublincore/trunk/src/zope/dublincore/tests/partial.txt
  U   zope.dublincore/trunk/src/zope/dublincore/tests/test_creatorannotator.py
  U   zope.dublincore/trunk/src/zope/dublincore/tests/test_zdcannotatableadapter.py
  U   zope.dublincore/trunk/src/zope/dublincore/zopedublincore.py

-=-
Modified: zope.dublincore/trunk/CHANGES.txt
===================================================================
--- zope.dublincore/trunk/CHANGES.txt	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/CHANGES.txt	2012-05-18 13:54:52 UTC (rev 126097)
@@ -2,12 +2,18 @@
 Changes
 =======
 
-3.8.3 (unreleased)
+4.0.0 (unreleased)
 ==================
 
-- TBD
+- Replaced deprecated ``zope.component.adapts`` usage with equivalent
+  ``zope.component.adapter`` decorator.
 
+- Replaced deprecated ``zope.interface.implements`` usage with equivalent
+  ``zope.interface.implementer`` decorator.
 
+- Dropped support for Python 2.4 and 2.5.
+
+
 3.8.2 (2010-02-19)
 ==================
 

Modified: zope.dublincore/trunk/setup.py
===================================================================
--- zope.dublincore/trunk/setup.py	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/setup.py	2012-05-18 13:54:52 UTC (rev 126097)
@@ -24,7 +24,7 @@
 def read(*path):
     return open(os.path.join(*path)).read() + '\n\n'
 
-version = '3.8.3dev'
+version = '4.0.0dev'
 
 long_description = (
     '.. contents::\n\n' +
@@ -47,6 +47,19 @@
     long_description=long_description,
     author='Zope Foundation and Contributors',
     author_email='zope-dev at zope.org',
+    classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Internet :: WWW/HTTP',
+        'Topic :: Software Development',
+        ],
 
     packages=find_packages('src'),
     package_dir={'':'src'},

Modified: zope.dublincore/trunk/src/zope/dublincore/annotatableadapter.py
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/annotatableadapter.py	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/annotatableadapter.py	2012-05-18 13:54:52 UTC (rev 126097)
@@ -19,8 +19,8 @@
 
 from zope.annotation.interfaces import IAnnotatable
 from zope.annotation.interfaces import IAnnotations
-from zope.component import adapts
-from zope.interface import implements
+from zope.component import adapter
+from zope.interface import implementer
 from zope.location import Location
 from zope.dublincore.interfaces import IWriteZopeDublinCore
 from zope.dublincore.zopedublincore import DateProperty
@@ -30,10 +30,10 @@
 DCkey = "zope.app.dublincore.ZopeDublinCore"
 
 
+ at implementer(IWriteZopeDublinCore)
+ at adapter(IAnnotatable)
 class ZDCAnnotatableAdapter(ZopeDublinCore, Location):
     """Adapt annotatable objects to Zope Dublin Core."""
-    implements(IWriteZopeDublinCore)
-    adapts(IAnnotatable)
 
     annotations = None
 

Modified: zope.dublincore/trunk/src/zope/dublincore/property.txt
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/property.txt	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/property.txt	2012-05-18 13:54:52 UTC (rev 126097)
@@ -9,8 +9,8 @@
 
   >>> from zope import interface
   >>> from zope.annotation.interfaces import IAttributeAnnotatable
-  >>> class DC(object):
-  ...     interface.implements(IAttributeAnnotatable)
+  >>> @interface.implementer(IAttributeAnnotatable)
+  ... class DC(object):
   ...     title   = property.DCProperty('title')
   ...     author  = property.DCProperty('creators')
   ...     authors = property.DCListProperty('creators')

Modified: zope.dublincore/trunk/src/zope/dublincore/tests/partial.txt
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/tests/partial.txt	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/tests/partial.txt	2012-05-18 13:54:52 UTC (rev 126097)
@@ -20,11 +20,9 @@
   >>> import zope.interface
   >>> import zope.annotation.interfaces
 
-  >>> class Content(object):
-  ...
-  ...     zope.interface.implements(
+  >>> @zope.interface.implementer(
   ...         zope.annotation.interfaces.IAttributeAnnotatable)
-  ...
+  ... class Content(object):
   ...     title = u""
   ...     description = u""
 
@@ -92,11 +90,9 @@
 Let's look at an example where we want the `abstract` attribute on the
 content object to be used for the `description` Dublin Core field::
 
-  >>> class Content(object):
-  ...
-  ...     zope.interface.implements(
+  >>> @zope.interface.implementer(
   ...         zope.annotation.interfaces.IAttributeAnnotatable)
-  ...
+  ... class Content(object):
   ...     abstract = u""
 
 We can create the adapter factory by passing a mapping to

Modified: zope.dublincore/trunk/src/zope/dublincore/tests/test_creatorannotator.py
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/tests/test_creatorannotator.py	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/tests/test_creatorannotator.py	2012-05-18 13:54:52 UTC (rev 126097)
@@ -48,10 +48,10 @@
 
     def _makeContextAndEvent(self):
 
-        from zope.interface import implements
+        from zope.interface import implementer
 
+        @implementer(self._iface)
         class DummyDublinCore(object):
-            implements(self._iface)
             creators = ()
 
         class DummyEvent(object):

Modified: zope.dublincore/trunk/src/zope/dublincore/tests/test_zdcannotatableadapter.py
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/tests/test_zdcannotatableadapter.py	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/tests/test_zdcannotatableadapter.py	2012-05-18 13:54:52 UTC (rev 126097)
@@ -17,10 +17,11 @@
 
 from zope.annotation.interfaces import IAnnotations
 from zope.component.testing import PlacelessSetup
-from zope.interface import implements
+from zope.interface import implementer
 
+ at implementer(IAnnotations)
 class TestAnnotations(dict):
-    implements(IAnnotations)
+    pass
 
 class DublinCoreAdapterTest(PlacelessSetup, unittest.TestCase):
 

Modified: zope.dublincore/trunk/src/zope/dublincore/zopedublincore.py
===================================================================
--- zope.dublincore/trunk/src/zope/dublincore/zopedublincore.py	2012-05-18 13:49:54 UTC (rev 126096)
+++ zope.dublincore/trunk/src/zope/dublincore/zopedublincore.py	2012-05-18 13:54:52 UTC (rev 126097)
@@ -17,7 +17,7 @@
 
 from datetime import datetime
 
-from zope.interface import implements
+from zope.interface import implementer
 from zope.datetime import parseDatetimetz
 from zope.dublincore.interfaces import IZopeDublinCore
 
@@ -88,6 +88,7 @@
         inst._changed()
         inst._mapping[self.__name__] = value
 
+ at implementer(IZopeDublinCore)
 class ZopeDublinCore(object):
     """Zope Dublin Core Mixin
 
@@ -96,8 +97,6 @@
     Just mix with `Persistence` to get a persistent version.
     """
 
-    implements(IZopeDublinCore)
-
     def __init__(self, mapping=None):
         if mapping is None:
             mapping = {}



More information about the checkins mailing list