From: Thomas Jarosch Date: Tue, 3 Jul 2012 12:49:49 +0000 (+0200) Subject: Fix spaces in the error output X-Git-Url: http://developer.intra2net.com/git/?p=imap-fix-internaldate;a=commitdiff_plain;h=89ca139f44ef3f7836a15bf9573a98f793697ec3 Fix spaces in the error output --- diff --git a/src/mail_iterator.py b/src/mail_iterator.py index f35866a..cb4ee73 100644 --- a/src/mail_iterator.py +++ b/src/mail_iterator.py @@ -101,7 +101,7 @@ class MailIterator: try: result, data = self.mail_con.uid('fetch', mid, '(INTERNALDATE)') except: - raise UserWarning("Could not fetch the internal date of message" + mid.decode('iso-8859-1') + ".") + raise UserWarning("Could not fetch the internal date of message " + mid.decode('iso-8859-1') + ".") internal_date = imaplib.Internaldate2tuple(data[0]) return internal_date @@ -110,7 +110,7 @@ class MailIterator: try: result, data = self.mail_con.uid('fetch', mid, '(BODY.PEEK[HEADER.FIELDS (RECEIVED)])') except: - raise UserWarning("Could not fetch the received header of message" + mid.decode('iso-8859-1') + ".") + raise UserWarning("Could not fetch the received header of message " + mid.decode('iso-8859-1') + ".") return data[0][1].decode('iso-8859-1') def fetch_basic_date(self, mid): @@ -118,8 +118,8 @@ class MailIterator: try: result, data = self.mail_con.uid('fetch', mid, '(BODY.PEEK[HEADER.FIELDS (DATE)])') except: - raise UserWarning("Could not fetch the date header of message" + mid.decode('iso-8859-1') + ".") - return data[0][1].decode('iso-8859-1') + raise UserWarning("Could not fetch the date header of message " + mid.decode('iso-8859-1') + ".") + return data[0][1].decode('iso-8859-1') def update_message(self, mid, mailbox, internal_date): """Replaces a message with one with correct internal date.""" @@ -136,11 +136,11 @@ class MailIterator: internal_date_str, data[0][1]) logging.debug("Adding corrected copy of the message reponse: %s %s", result, data) except: - raise UserWarning("Could not replace the e-mail" + mid.decode('iso-8859-1') + ".") + raise UserWarning("Could not replace the e-mail " + mid.decode('iso-8859-1') + ".") try: result, data = self.mail_con.uid('STORE', mid, '+FLAGS', r'(\Deleted)') logging.debug("Removing old copy of the message reponse: %s %s", result, data) except: - raise UserWarning("Could not delete the e-mail" + mid.decode('iso-8859-1') + ".") + raise UserWarning("Could not delete the e-mail " + mid.decode('iso-8859-1') + ".") self.mail_con.expunge() return