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

Tres Seaver cvs-admin at zope.org
Fri May 18 16:08:08 UTC 2012


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

Changed:
  U   zope.sendmail/trunk/CHANGES.txt
  U   zope.sendmail/trunk/setup.py
  U   zope.sendmail/trunk/src/zope/sendmail/README.txt
  U   zope.sendmail/trunk/src/zope/sendmail/delivery.py
  U   zope.sendmail/trunk/src/zope/sendmail/event.py
  U   zope.sendmail/trunk/src/zope/sendmail/maildir.py
  U   zope.sendmail/trunk/src/zope/sendmail/mailer.py
  U   zope.sendmail/trunk/src/zope/sendmail/tests/test_delivery.py
  U   zope.sendmail/trunk/src/zope/sendmail/tests/test_directives.py
  U   zope.sendmail/trunk/src/zope/sendmail/vocabulary.py

-=-
Modified: zope.sendmail/trunk/CHANGES.txt
===================================================================
--- zope.sendmail/trunk/CHANGES.txt	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/CHANGES.txt	2012-05-18 16:07:45 UTC (rev 126155)
@@ -2,20 +2,28 @@
 CHANGES
 =======
 
-3.8.0 (unreleased)
+4.0.0 (unreleased)
 ------------------
 
-- Add a vote method to Mailer implementations to allow them to abort a
+- Replaced deprecated ``zope.interface.classProvides`` usage with equivalent
+  ``zope.interface.provider`` decorator.
+
+- Replaced deprecated ``zope.interface.implements`` usage with equivalent
+  ``zope.interface.implementer`` decorator.
+
+- Dropped support for Python 2.4 and 2.5.
+
+- Added a vote method to Mailer implementations to allow them to abort a
   transaction if it is known to be unsafe.
 
-- Prevent fatal errors in mail delivery causing potential database corruption.
+- Prevented fatal errors in mail delivery causing potential database corruption.
 
 - Added not declared, but needed test dependency on `zope.component [test]`.
 
-- Handle unicode usernames and passwords, encoding them to UTF-8. Fix for
-  https://bugs.launchpad.net/zope.sendmail/+bug/597143
+- Added handling for unicode usernames and passwords, encoding them to UTF-8.
+  Fix for https://bugs.launchpad.net/zope.sendmail/+bug/597143
 
-- Give the background queue processor thread a name.
+- Gave the background queue processor thread a name.
 
 3.7.2 (2010-04-30)
 ------------------

Modified: zope.sendmail/trunk/setup.py
===================================================================
--- zope.sendmail/trunk/setup.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/setup.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -28,7 +28,7 @@
 
 
 setup(name='zope.sendmail',
-      version = '3.8.0dev',
+      version = '4.0.0dev',
       url='http://pypi.python.org/pypi/zope.sendmail',
       license='ZPL 2.1',
       description='Zope sendmail',
@@ -45,8 +45,6 @@
           'License :: OSI Approved :: Zope Public Licence',
           'Programming Language :: Python',
           'Programming Language :: Python :: 2',
-          'Programming Language :: Python :: 2.4',
-          'Programming Language :: Python :: 2.5',
           'Programming Language :: Python :: 2.6',
           'Programming Language :: Python :: 2.7',
           'Operating System :: OS Independent',

Modified: zope.sendmail/trunk/src/zope/sendmail/README.txt
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/README.txt	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/README.txt	2012-05-18 16:07:45 UTC (rev 126155)
@@ -102,8 +102,8 @@
 real emails.  You'll have to define a fake email delivery utility in your
 test layer.  Something like this will do the trick::
 
+    @implements(IMailDelivery)
     class FakeMailDelivery(object):
-        implements(IMailDelivery)
 
         def send(self, source, dest, body):
             print "*** Sending email from %s to %s:" % (source, dest)

Modified: zope.sendmail/trunk/src/zope/sendmail/delivery.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/delivery.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/delivery.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -26,7 +26,7 @@
 from time import strftime
 from socket import gethostname
 
-from zope.interface import implements
+from zope.interface import implementer
 from zope.sendmail.interfaces import IDirectMailDelivery, IQueuedMailDelivery
 from zope.sendmail.maildir import Maildir
 from transaction.interfaces import IDataManager
@@ -38,8 +38,8 @@
 
 log = logging.getLogger("MailDataManager")
 
+ at implementer(IDataManager)
 class MailDataManager(object):
-    implements(IDataManager)
 
     def __init__(self, callable, args=(), vote=None, onAbort=None):
         self.callable = callable
@@ -115,11 +115,10 @@
         return messageid
 
 
+ at implementer(IDirectMailDelivery)
 class DirectMailDelivery(AbstractMailDelivery):
     __doc__ = IDirectMailDelivery.__doc__
 
-    implements(IDirectMailDelivery)
-
     def __init__(self, mailer):
         self.mailer = mailer
 
@@ -140,11 +139,10 @@
                                onAbort=self.mailer.abort)
 
 
+ at implementer(IQueuedMailDelivery)
 class QueuedMailDelivery(AbstractMailDelivery):
     __doc__ = IQueuedMailDelivery.__doc__
 
-    implements(IQueuedMailDelivery)
-
     def __init__(self, queuePath):
         self._queuePath = queuePath
 

Modified: zope.sendmail/trunk/src/zope/sendmail/event.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/event.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/event.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -15,25 +15,23 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.interface import implements
+from zope.interface import implementer
 
 from zope.sendmail.interfaces import IMailSentEvent, IMailErrorEvent
 
 
+ at implementer(IMailSentEvent)
 class MailSentEvent(object):
     __doc__ = IMailSentEvent.__doc__
 
-    implements(IMailSentEvent)
-
     def __init__(self, messageId):
         self.messageId = messageId
 
 
+ at implementer(IMailErrorEvent)
 class MailErrorEvent(object):
     __doc__ = IMailErrorEvent.__doc__
 
-    implements(IMailErrorEvent)
-
     def __init__(self, messageId, errorMessage):
         self.messageId = messageId
         self.errorMessage = errorMessage

Modified: zope.sendmail/trunk/src/zope/sendmail/maildir.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/maildir.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/maildir.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -21,18 +21,17 @@
 import time
 import random
 
-from zope.interface import implements, classProvides
+from zope.interface import implementer, provider
 
 from zope.sendmail.interfaces import \
      IMaildirFactory, IMaildir, IMaildirMessageWriter
 
 
+ at provider(IMaildirFactory)
+ at implementer(IMaildir)
 class Maildir(object):
     """See `zope.sendmail.interfaces.IMaildir`"""
 
-    classProvides(IMaildirFactory)
-    implements(IMaildir)
-
     def __init__(self, path, create=False):
         "See `zope.sendmail.interfaces.IMaildirFactory`"
         self.path = path
@@ -118,10 +117,10 @@
     return s
 
 
+ at implementer(IMaildirMessageWriter)
 class MaildirMessageWriter(object):
     """See `zope.sendmail.interfaces.IMaildirMessageWriter`"""
 
-    implements(IMaildirMessageWriter)
 
     def __init__(self, fd, filename, new_filename):
         self._filename = filename

Modified: zope.sendmail/trunk/src/zope/sendmail/mailer.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/mailer.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/mailer.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -18,14 +18,14 @@
 import socket
 from smtplib import SMTP
 
-from zope.interface import implements
+from zope.interface import implementer
 from zope.sendmail.interfaces import ISMTPMailer
 
 have_ssl = hasattr(socket, 'ssl')
 
+ at implementer(ISMTPMailer)
 class SMTPMailer(object):
 
-    implements(ISMTPMailer)
 
     smtp = SMTP
 

Modified: zope.sendmail/trunk/src/zope/sendmail/tests/test_delivery.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/tests/test_delivery.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/tests/test_delivery.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -21,14 +21,14 @@
 import doctest
 
 import transaction
-from zope.interface import implements
+from zope.interface import implementer
 from zope.interface.verify import verifyObject
 from zope.sendmail.interfaces import IMailer
 
 
+ at implementer(IMailer)
 class MailerStub(object):
 
-    implements(IMailer)
     def __init__(self, *args, **kw):
         self.sent_messages = []
 
@@ -267,9 +267,9 @@
     pass
 
 
+ at implementer(IMailer)
 class BrokenMailerStub(object):
 
-    implements(IMailer)
     def __init__(self, *args, **kw):
         pass
 
@@ -280,9 +280,9 @@
     abort = None
 
 
+ at implementer(IMailer)
 class RefusingMailerStub(object):
 
-    implements(IMailer)
     def __init__(self, *args, **kw):
         pass
 
@@ -294,9 +294,9 @@
 
     abort = None
 
+ at implementer(IMailer)
 class SMTPResponseExceptionMailerStub(object):
 
-    implements(IMailer)
     def __init__(self, code):
         self.code = code
 

Modified: zope.sendmail/trunk/src/zope/sendmail/tests/test_directives.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/tests/test_directives.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/tests/test_directives.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -23,7 +23,7 @@
 import zope.component
 from zope.component.testing import PlacelessSetup
 from zope.configuration import xmlconfig
-from zope.interface import implements
+from zope.interface import implementer
 
 from zope.sendmail.interfaces import \
      IMailDelivery, IMailer, ISMTPMailer
@@ -44,8 +44,9 @@
     def newMessage(self):
         return None
 
+ at implementer(IMailer)
 class Mailer(object):
-    implements(IMailer)
+    pass
 
 
 class DirectivesTest(PlacelessSetup, unittest.TestCase):

Modified: zope.sendmail/trunk/src/zope/sendmail/vocabulary.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/vocabulary.py	2012-05-18 15:59:28 UTC (rev 126154)
+++ zope.sendmail/trunk/src/zope/sendmail/vocabulary.py	2012-05-18 16:07:45 UTC (rev 126155)
@@ -26,9 +26,10 @@
 
     Let's provide a few stub utilities:
 
-      >>> from zope.interface import implements
-      >>> class StubMailDelivery(object):
-      ...     implements(IMailDelivery)
+      >>> from zope.interface import implementer
+      >>> @implementer(IMailDelivery)
+      ... class StubMailDelivery(object):
+      ...     pass
 
       >>> from zope.component import provideUtility
       >>> for name in 'and now for something completely different'.split():



More information about the checkins mailing list