[Checkins] SVN: zope.sendmail/trunk/ Deleted event fossils

Tres Seaver cvs-admin at zope.org
Wed May 23 13:46:33 UTC 2012


Log message for revision 126464:
  Deleted event fossils
  
  Includes innterfaces 'zope.sendmail.interfaces.IMailSent' and
  'zope.sendmail.interfaces.IMailError'. plus the 'zope.sendmail.events'
  module and associated tests).  These events were never emitted, and couldn't
  have been used safely even if they had been, due to two-phase commit.
  
  See: https://bugs.launchpad.net/zope3/+bug/177739 
  
  

Changed:
  U   zope.sendmail/trunk/CHANGES.txt
  U   zope.sendmail/trunk/README.txt
  U   zope.sendmail/trunk/src/zope/sendmail/README.txt
  D   zope.sendmail/trunk/src/zope/sendmail/event.py
  U   zope.sendmail/trunk/src/zope/sendmail/interfaces.py
  D   zope.sendmail/trunk/src/zope/sendmail/tests/test_event.py

-=-
Modified: zope.sendmail/trunk/CHANGES.txt
===================================================================
--- zope.sendmail/trunk/CHANGES.txt	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/CHANGES.txt	2012-05-23 13:46:29 UTC (rev 126464)
@@ -5,6 +5,12 @@
 4.0.0 (unreleased)
 ------------------
 
+- Deleted event fossils (interfaces ``zope.sendmail.interfaces.IMailSent`` and
+  ``zope.sendmail.interfaces.IMailError``. plus the ``zope.sendmail.events``
+  module and associated tests).  These events were never emitted, and couldn't
+  have been used safely even if they had been, due to two-phase commit.
+  https://bugs.launchpad.net/zope3/+bug/177739 
+
 - Replaced deprecated ``zope.interface.classProvides`` usage with equivalent
   ``zope.interface.provider`` decorator.
 

Modified: zope.sendmail/trunk/README.txt
===================================================================
--- zope.sendmail/trunk/README.txt	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/README.txt	2012-05-23 13:46:29 UTC (rev 126464)
@@ -40,7 +40,3 @@
 mailer:
 
 ``ISMTPMailer`` sends all messages to a relay host using SMTP.
-
-If mail delivery succeeds, an ``IMailSentEvent`` is dispatched by the
-mailer.  If mail delivery fails, no exceptions are raised, but an
-`IMailErrorEvent` is dispatched by the mailer.

Modified: zope.sendmail/trunk/src/zope/sendmail/README.txt
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/README.txt	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/src/zope/sendmail/README.txt	2012-05-23 13:46:29 UTC (rev 126464)
@@ -122,6 +122,3 @@
   formatting by yourself).
 
 * The configuration should be done in zope.conf, not in ZCML.
-
-* The IMailSentEvent and IMailErrorEvent events aren't used and can't be used
-  (you don't want to send emails during the commit phase).

Deleted: zope.sendmail/trunk/src/zope/sendmail/event.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/event.py	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/src/zope/sendmail/event.py	2012-05-23 13:46:29 UTC (rev 126464)
@@ -1,37 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Collection of possible Mail Events.
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.interface import implementer
-
-from zope.sendmail.interfaces import IMailSentEvent, IMailErrorEvent
-
-
- at implementer(IMailSentEvent)
-class MailSentEvent(object):
-    __doc__ = IMailSentEvent.__doc__
-
-    def __init__(self, messageId):
-        self.messageId = messageId
-
-
- at implementer(IMailErrorEvent)
-class MailErrorEvent(object):
-    __doc__ = IMailErrorEvent.__doc__
-
-    def __init__(self, messageId, errorMessage):
-        self.messageId = messageId
-        self.errorMessage = errorMessage

Modified: zope.sendmail/trunk/src/zope/sendmail/interfaces.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/interfaces.py	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/src/zope/sendmail/interfaces.py	2012-05-23 13:46:29 UTC (rev 126464)
@@ -45,10 +45,6 @@
   delivery process.  There currently is only one mailer:
 
     - `ISMTPMailer` sends all messages to a relay host using SMTP
-
-- If mail delivery succeeds, an `IMailSentEvent` is dispatched by the mailer.
-  If mail delivery fails, no exceptions are raised, but an `IMailErrorEvent` is
-  dispatched by the mailer.
 """
 __docformat__ = 'restructuredtext'
 
@@ -137,9 +133,6 @@
         headers.
 
         Messages are sent immediately.
-
-        Dispatches an `IMailSentEvent` on successful delivery, otherwise an
-        `IMailErrorEvent`.
         """
     
     def abort():
@@ -179,28 +172,6 @@
         description=_(u"Use TLS always for sending email."))
 
 
-class IMailEvent(Interface):
-    """Generic mail event."""
-
-    messageId = Attribute("Message id according to RFC 2822")
-
-
-class IMailSentEvent(IMailEvent):
-    """Event that is fired when a message is succesfully sent.
-
-    This does not mean that all the recipients have received it, it only
-    means that the message left this system successfully.  It is possible
-    that a bounce message will arrive later from some remote mail server.
-    """
-
-
-class IMailErrorEvent(IMailEvent):
-    """Event that is fired when a message cannot be delivered."""
-
-    errorMessage = Attribute("Error message")
-
-
-
 class IMaildirFactory(Interface):
 
     def __call__(dirname, create=False):

Deleted: zope.sendmail/trunk/src/zope/sendmail/tests/test_event.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/tests/test_event.py	2012-05-23 13:33:45 UTC (rev 126463)
+++ zope.sendmail/trunk/src/zope/sendmail/tests/test_event.py	2012-05-23 13:46:29 UTC (rev 126464)
@@ -1,48 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Mailer Events Tests
-"""
-from unittest import TestCase, TestSuite, makeSuite
-
-from zope.interface.verify import verifyObject
-
-from zope.sendmail.interfaces import IMailSentEvent, IMailErrorEvent
-from zope.sendmail.event import MailSentEvent
-
-
-class TestMailEvents(TestCase):
-
-    def testMailSendEvent(self):
-        msgid = '<1234 at example.com>'
-        m = MailSentEvent(msgid)
-        verifyObject(IMailSentEvent, m)
-        self.assertEquals(m.messageId, msgid)
-
-    def testMailErrorEvent(self):
-        from zope.sendmail.event import MailErrorEvent
-        msgid = '<1234 at example.com>'
-        error = '550 Relay access denied'
-        m = MailErrorEvent(msgid, error)
-        verifyObject(IMailErrorEvent, m)
-        self.assertEquals(m.messageId, msgid)
-        self.assertEquals(m.errorMessage, error)
-
-
-def test_suite():
-    return TestSuite((
-        makeSuite(TestMailEvents),
-        ))
-
-if __name__ == '__main__':
-    unittest.main()



More information about the checkins mailing list