[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/mail/ Cleaned up gratuitous XXX'es in the zope.app.mail package.

Albertas Agejevas alga at pov.lt
Wed Jul 21 09:06:32 EDT 2004


Log message for revision 26648:
  Cleaned up gratuitous XXX'es in the zope.app.mail package.
  Most of them were just notes on implementation anyway.
  


Changed:
  U   Zope3/trunk/src/zope/app/mail/delivery.py
  U   Zope3/trunk/src/zope/app/mail/interfaces.py
  U   Zope3/trunk/src/zope/app/mail/maildir.py
  U   Zope3/trunk/src/zope/app/mail/tests/test_maildir.py


-=-
Modified: Zope3/trunk/src/zope/app/mail/delivery.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/delivery.py	2004-07-21 12:14:33 UTC (rev 26647)
+++ Zope3/trunk/src/zope/app/mail/delivery.py	2004-07-21 13:06:32 UTC (rev 26648)
@@ -176,7 +176,7 @@
                     fromaddr, toaddrs, message = self._parseMessage(message)
                     self.mailer.send(fromaddr, toaddrs, message)
                     unlink(filename)
-                    # XXX maybe log the Message-Id of the message sent
+                    # TODO: maybe log the Message-Id of the message sent
                     self.log.info("Mail from %s to %s sent.",
                                   fromaddr, ", ".join(toaddrs))
                     # Blanket except because we don't want

Modified: Zope3/trunk/src/zope/app/mail/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/interfaces.py	2004-07-21 12:14:33 UTC (rev 26647)
+++ Zope3/trunk/src/zope/app/mail/interfaces.py	2004-07-21 13:06:32 UTC (rev 26648)
@@ -36,7 +36,7 @@
   but that is not a problem, because mail delivery problems dispatch an
   event instead of raising an exception.
 
-  XXX and there's the problem -- sending events causes unknown code to be
+  However, there is a problem -- sending events causes unknown code to be
   executed during the transaction commit phase.  There should be a way to
   start a new transaction for event processing after this one is commited.
 

Modified: Zope3/trunk/src/zope/app/mail/maildir.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/maildir.py	2004-07-21 12:14:33 UTC (rev 26647)
+++ Zope3/trunk/src/zope/app/mail/maildir.py	2004-07-21 13:06:32 UTC (rev 26648)
@@ -13,8 +13,6 @@
 ##############################################################################
 """Read/write access to Maildir folders.
 
-XXX check exception types
-
 $Id$
 """
 import os
@@ -72,9 +70,9 @@
 
     def newMessage(self):
         "See zope.app.interfaces.mail.IMaildir"
-        # XXX http://www.qmail.org/man/man5/maildir.html says, that the first
-        #     step of the delivery process should be a chdir.  Chdirs and
-        #     threading do not mix.  Is that chdir really necessary?
+        # NOTE: http://www.qmail.org/man/man5/maildir.html says, that the first
+        #       step of the delivery process should be a chdir.  Chdirs and
+        #       threading do not mix.  Is that chdir really necessary?
         join = os.path.join
         subdir_tmp = join(self.path, 'tmp')
         subdir_new = join(self.path, 'new')
@@ -88,11 +86,11 @@
             if not os.path.exists(filename):
                 break
             counter += 1
-            if counter >= 1000:  # XXX hardcoded magic number
+            if counter >= 1000:
                 raise RuntimeError("Failed to create unique file name in %s,"
                                    " are we under a DoS attack?" % subdir_tmp)
-            # XXX maildir.html (see above) says I should sleep for 2
-            # seconds, not 1
+            # NOTE: maildir.html (see above) says I should sleep for 2
+            #       seconds, not 1
             time.sleep(1)
         return MaildirMessageWriter(filename, join(subdir_new, unique))
 
@@ -120,14 +118,14 @@
 
     def commit(self):
         if self._closed and self._aborted:
-            raise AssertionError('Cannot commit, message already aborted')
+            raise RuntimeError('Cannot commit, message already aborted')
         elif not self._closed:
             self._closed = True
             self._aborted = False
             self._fd.close()
             os.rename(self._filename, self._new_filename)
-            # XXX the same maildir.html says it should be a link, followed by
-            #     unlink.  But Win32 does not necessarily have hardlinks!
+            # NOTE: the same maildir.html says it should be a link, followed by
+            #       unlink.  But Win32 does not necessarily have hardlinks!
 
     def abort(self):
         if not self._closed:
@@ -136,4 +134,4 @@
             self._fd.close()
             os.unlink(self._filename)
 
-    # XXX should there be a __del__ that does abort()?
+    # should there be a __del__ that does abort()?

Modified: Zope3/trunk/src/zope/app/mail/tests/test_maildir.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/tests/test_maildir.py	2004-07-21 12:14:33 UTC (rev 26647)
+++ Zope3/trunk/src/zope/app/mail/tests/test_maildir.py	2004-07-21 13:06:32 UTC (rev 26648)
@@ -227,7 +227,7 @@
         writer.abort()
         self.assertEquals(self.fake_os_module._removed_files, ())
         # Once aborted, commit fails
-        self.assertRaises(AssertionError, writer.commit)
+        self.assertRaises(RuntimeError, writer.commit)
 
     def test_message_writer_commit(self):
         from zope.app.mail.maildir import MaildirMessageWriter



More information about the Zope3-Checkins mailing list