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

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


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

Changed:
  U   zope.catalog/trunk/CHANGES.txt
  U   zope.catalog/trunk/setup.py
  U   zope.catalog/trunk/src/zope/catalog/README.txt
  U   zope.catalog/trunk/src/zope/catalog/attribute.py
  U   zope.catalog/trunk/src/zope/catalog/catalog.py
  U   zope.catalog/trunk/src/zope/catalog/event.txt
  U   zope.catalog/trunk/src/zope/catalog/field.py
  U   zope.catalog/trunk/src/zope/catalog/keyword.py
  U   zope.catalog/trunk/src/zope/catalog/tests.py
  U   zope.catalog/trunk/src/zope/catalog/text.py

-=-
Modified: zope.catalog/trunk/CHANGES.txt
===================================================================
--- zope.catalog/trunk/CHANGES.txt	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/CHANGES.txt	2012-05-18 13:22:40 UTC (rev 126084)
@@ -2,12 +2,15 @@
 CHANGES
 =======
 
-3.8.3 (unreleased)
+4.0.0 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Replaced deprecated ``zope.interface.implements`` usage with equivalent
+  ``zope.interface.implementer`` decorator.
 
+- Dropped support for Python 2.4 and 2.5.
 
+
 3.8.2 (2011-11-29)
 ------------------
 

Modified: zope.catalog/trunk/setup.py
===================================================================
--- zope.catalog/trunk/setup.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/setup.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -25,7 +25,7 @@
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
 setup(name = 'zope.catalog',
-      version='3.8.3dev',
+      version='4.0.0dev',
       author='Zope Corporation and Contributors',
       author_email='zope-dev at zope.org',
       description='Cataloging and Indexing Framework for the Zope Toolkit',
@@ -48,6 +48,9 @@
           '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',

Modified: zope.catalog/trunk/src/zope/catalog/README.txt
===================================================================
--- zope.catalog/trunk/src/zope/catalog/README.txt	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/README.txt	2012-05-18 13:22:40 UTC (rev 126084)
@@ -18,12 +18,12 @@
     >>> import persistent, BTrees.OOBTree, BTrees.IFBTree, BTrees.IOBTree
     >>> import zope.interface, zope.index.interfaces
 
-    >>> class BaseIndex(persistent.Persistent):
-    ...     zope.interface.implements(
+    >>> @zope.interface.implementer(
     ...         zope.index.interfaces.IInjection,
     ...         zope.index.interfaces.IIndexSearch,
     ...         zope.index.interfaces.IIndexSort,
     ...         )
+    ... class BaseIndex(persistent.Persistent):
     ...
     ...     def clear(self):
     ...         self.forward = BTrees.OOBTree.OOBTree()
@@ -72,11 +72,12 @@
     >>> import zope.catalog.interfaces
     >>> import zope.container.contained
 
-    >>> class Index(zope.catalog.attribute.AttributeIndex, 
+    >>> @zope.interface.implementer(zope.catalog.interfaces.ICatalogIndex)
+    ... class Index(zope.catalog.attribute.AttributeIndex, 
     ...             BaseIndex,
     ...             zope.container.contained.Contained,
     ...             ):
-    ...    zope.interface.implements(zope.catalog.interfaces.ICatalogIndex)
+    ...    pass
 
 Unfortunately, because of the way we currently handle containment
 constraints, we have to provide `ICatalogIndex`, which extends
@@ -115,15 +116,15 @@
 
 Now, let's create some objects and index them:
 
-    >>> class Person:
-    ...     zope.interface.implements(IPerson)
+    >>> @zope.interface.implementer(IPerson)
+    ... class Person:
     ...     def __init__(self, age):
     ...         self._age = age
     ...     def age(self):
     ...         return self._age
 
-    >>> class Discriminating:
-    ...     zope.interface.implements(IFavoriteColor)
+    >>> @zope.interface.implementer(IFavoriteColor)
+    ... class Discriminating:
     ...     def __init__(self, color):
     ...         self.color = color
 
@@ -192,8 +193,8 @@
 create a utility to work with our catalog:
 
     >>> import zope.intid.interfaces
-    >>> class Ids:
-    ...     zope.interface.implements(zope.intid.interfaces.IIntIds)
+    >>> @zope.interface.implementer(zope.intid.interfaces.IIntIds)
+    ... class Ids:
     ...     def __init__(self, data):
     ...         self.data = data
     ...     def getObject(self, id):
@@ -288,11 +289,11 @@
 create a new index, a "keyword index" that indexes sequences of
 values:
 
-    >>> class BaseKeywordIndex(persistent.Persistent):
-    ...     zope.interface.implements(
+    >>> @zope.interface.implementer(
     ...         zope.index.interfaces.IInjection,
     ...         zope.index.interfaces.IIndexSearch,
     ...         )
+    ... class BaseKeywordIndex(persistent.Persistent):
     ...
     ...     def clear(self):
     ...         self.forward = BTrees.OOBTree.OOBTree()
@@ -328,11 +329,12 @@
     ...                 _, result = BTrees.IFBTree.weightedUnion(result, set)
     ...         return result
 
-    >>> class KeywordIndex(zope.catalog.attribute.AttributeIndex, 
+    >>> @zope.interface.implementer(zope.catalog.interfaces.ICatalogIndex)
+    ... class KeywordIndex(zope.catalog.attribute.AttributeIndex, 
     ...                    BaseKeywordIndex,
     ...                    zope.container.contained.Contained,
     ...                    ):
-    ...    zope.interface.implements(zope.catalog.interfaces.ICatalogIndex)
+    ...    pass
 
 Now, we'll add a hobbies index:
 

Modified: zope.catalog/trunk/src/zope/catalog/attribute.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/attribute.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/attribute.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -18,6 +18,7 @@
 import zope.interface
 from zope.catalog.interfaces import IAttributeIndex
 
+ at zope.interface.implementer(IAttributeIndex)
 class AttributeIndex(object):
     """Index interface-defined attributes
 
@@ -102,8 +103,6 @@
 
        """
 
-    zope.interface.implements(IAttributeIndex)
-
     default_field_name = None
     default_interface = None
 

Modified: zope.catalog/trunk/src/zope/catalog/catalog.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/catalog.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/catalog.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -21,7 +21,7 @@
 from zope.annotation.interfaces import IAttributeAnnotatable
 from zope.container.btree import BTreeContainer
 from zope.container.interfaces import IObjectAddedEvent
-from zope.interface import implements
+from zope.interface import implementer
 from zope.intid.interfaces import IIntIds, IIntIdAddedEvent, IIntIdRemovedEvent
 from zope.lifecycleevent import IObjectModifiedEvent
 from zope.location import location
@@ -45,13 +45,12 @@
             yield obj
 
 
+ at implementer(ICatalog,
+             IAttributeAnnotatable,
+             zope.index.interfaces.IIndexSearch,
+            )
 class Catalog(BTreeContainer):
 
-    implements(ICatalog,
-               IAttributeAnnotatable,
-               zope.index.interfaces.IIndexSearch,
-               )
-
     family = BTrees.family32
 
     def __init__(self, family=None):

Modified: zope.catalog/trunk/src/zope/catalog/event.txt
===================================================================
--- zope.catalog/trunk/src/zope/catalog/event.txt	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/event.txt	2012-05-18 13:22:40 UTC (rev 126084)
@@ -12,9 +12,9 @@
 
     >>> from zope.catalog.interfaces import ICatalog
     >>> from zope import interface, component
-    >>> class FakeCatalog(object):
+    >>> @interface.implementer(ICatalog)
+    ... class FakeCatalog(object):
     ...     indexed = []
-    ...     interface.implements(ICatalog)
     ...     def index_doc(self, docid, obj):
     ...         self.indexed.append((docid, obj))
     >>> cat = FakeCatalog()

Modified: zope.catalog/trunk/src/zope/catalog/field.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/field.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/field.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -25,8 +25,8 @@
     """Interface-based catalog field index
     """
 
+ at zope.interface.implementer(IFieldIndex)
 class FieldIndex(zope.catalog.attribute.AttributeIndex,
                  zope.index.field.FieldIndex,
                  zope.container.contained.Contained):
-
-    zope.interface.implements(IFieldIndex)
+    pass

Modified: zope.catalog/trunk/src/zope/catalog/keyword.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/keyword.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/keyword.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -24,14 +24,15 @@
                     zope.catalog.interfaces.ICatalogIndex):
     """Interface-based catalog keyword index"""
 
+ at zope.interface.implementer(IKeywordIndex)
 class KeywordIndex(zope.catalog.attribute.AttributeIndex,
                    zope.index.keyword.KeywordIndex,
                    zope.container.contained.Contained):
+    pass
 
-    zope.interface.implements(IKeywordIndex)
-
-class CaseInsensitiveKeywordIndex(zope.catalog.attribute.AttributeIndex,
-                                  zope.index.keyword.CaseInsensitiveKeywordIndex,
-                                  zope.container.contained.Contained):
-
-    zope.interface.implements(IKeywordIndex)
+ at zope.interface.implementer(IKeywordIndex)
+class CaseInsensitiveKeywordIndex(
+            zope.catalog.attribute.AttributeIndex,
+            zope.index.keyword.CaseInsensitiveKeywordIndex,
+            zope.container.contained.Contained):
+    pass

Modified: zope.catalog/trunk/src/zope/catalog/tests.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/tests.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/tests.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -18,7 +18,7 @@
 """
 import unittest
 from zope.testing import doctest
-from zope.interface import implements, Interface
+from zope.interface import implementer, Interface
 from zope.interface.verify import verifyObject
 from BTrees.IFBTree import IFSet
 from zope.intid.interfaces import IIntIds
@@ -51,9 +51,9 @@
         return self.obj
 
 
+ at implementer(IIntIds)
 class IntIdsStub:
     """A stub for IntIds."""
-    implements(IIntIds)
 
     def __init__(self):
         self.ids = {}
@@ -91,11 +91,10 @@
         return self.objs.iterkeys()
 
 
+ at implementer(IIndexSearch, IInjection)
 class StubIndex:
     """A stub for Index."""
 
-    implements(IIndexSearch, IInjection)
-
     def __init__(self, field_name, interface=None):
         self._field_name = field_name
         self.interface = interface
@@ -220,8 +219,9 @@
                           simiantype='monkey', hat='beret')
 
 
+ at implementer(ICatalog)
 class CatalogStub:
-    implements(ICatalog)
+
     def __init__(self):
         self.regs = []
         self.unregs = []

Modified: zope.catalog/trunk/src/zope/catalog/text.py
===================================================================
--- zope.catalog/trunk/src/zope/catalog/text.py	2012-05-18 13:20:12 UTC (rev 126083)
+++ zope.catalog/trunk/src/zope/catalog/text.py	2012-05-18 13:22:40 UTC (rev 126084)
@@ -48,8 +48,8 @@
         default=True,
         )
 
+ at zope.interface.implementer(ITextIndex)
 class TextIndex(zope.catalog.attribute.AttributeIndex,
                 zope.index.text.TextIndex,
                 zope.container.contained.Contained):
-
-    zope.interface.implements(ITextIndex)
+    pass



More information about the checkins mailing list