diff src/plugins/plugin_misc_maildir.py @ 1409:3265a2639182

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:57 +0200
parents 3b1c5f723c4b
children 7a8a19e4fa6c
line wrap: on
line diff
--- a/src/plugins/plugin_misc_maildir.py	Thu Apr 16 13:31:14 2015 +0200
+++ b/src/plugins/plugin_misc_maildir.py	Thu Apr 16 14:57:57 2015 +0200
@@ -128,7 +128,7 @@
         @param mailboxUser: MailboxUser instance"""
         if boxname not in self.__mailboxes:
             err_msg = _("Trying to remove an mailboxUser not referenced")
-            log.error(_("INTERNAL ERROR: ") + err_msg)
+            log.error(_(u"INTERNAL ERROR: ") + err_msg)
             raise MaildirError(err_msg)
         assert self.__mailboxes[profile][boxname] == mailboxUser
         del self.__mailboxes[profile][boxname]
@@ -147,7 +147,7 @@
             return self.data[profile][boxname]  # the boxname MUST exist in the data
         except KeyError:
             err_msg = _("Boxname doesn't exist in internal data")
-            log.error(_("INTERNAL ERROR: ") + err_msg)
+            log.error(_(u"INTERNAL ERROR: ") + err_msg)
             raise MaildirError(err_msg)
 
     def getUid(self, boxname, message_id, profile):
@@ -285,22 +285,22 @@
         @param boxname: name of the box which was observed
         @param signal: which signal was observed by the caller"""
         if (profile, boxname) not in self.__observed:
-            err_msg = _("Trying to remove an observer for an inexistant mailbox")
-            log.error(_("INTERNAL ERROR: ") + err_msg)
+            err_msg = _(u"Trying to remove an observer for an inexistant mailbox")
+            log.error(_(u"INTERNAL ERROR: ") + err_msg)
             raise MaildirError(err_msg)
         if signal not in self.__observed[(profile, boxname)]:
-            err_msg = _("Trying to remove an inexistant observer, no observer for this signal")
-            log.error(_("INTERNAL ERROR: ") + err_msg)
+            err_msg = _(u"Trying to remove an inexistant observer, no observer for this signal")
+            log.error(_(u"INTERNAL ERROR: ") + err_msg)
             raise MaildirError(err_msg)
         if not callback in self.__observed[(profile, boxname)][signal]:
-            err_msg = _("Trying to remove an inexistant observer")
-            log.error(_("INTERNAL ERROR: ") + err_msg)
+            err_msg = _(u"Trying to remove an inexistant observer")
+            log.error(_(u"INTERNAL ERROR: ") + err_msg)
             raise MaildirError(err_msg)
         self.__observed[(profile, boxname)][signal].remove(callback)
 
     def emitSignal(self, profile, boxname, signal_name):
         """Emit the signal to observer"""
-        log.debug('emitSignal %s %s %s' % (profile, boxname, signal_name))
+        log.debug(u'emitSignal %s %s %s' % (profile, boxname, signal_name))
         try:
             for observer_cb in self.__observed[(profile, boxname)][signal_name]:
                 observer_cb()
@@ -336,7 +336,7 @@
            @param profile: real profile (ie not a profile_key)
            THIS OBJECT MUST NOT BE USED DIRECTLY: use MaildirBox.accessMessageBox instead"""
         if _maildir._checkBoxReference(name, profile):
-            log.error("INTERNAL ERROR: MailboxUser MUST NOT be instancied directly")
+            log.error(u"INTERNAL ERROR: MailboxUser MUST NOT be instancied directly")
             raise MaildirError('double MailboxUser instanciation')
         if name != "INBOX":
             raise NotImplementedError
@@ -354,7 +354,7 @@
         self.__uid_table_update()
 
         if observer:
-            log.debug("adding observer for %s (%s)" % (name, profile))
+            log.debug(u"adding observer for %s (%s)" % (name, profile))
             self.maildir.addObserver(observer, profile, name, "NEW_MESSAGE")
 
     def __uid_table_update(self):
@@ -367,7 +367,7 @@
 
     def __del__(self):
         if self.observer:
-            log.debug("removing observer for %s" % self.name)
+            log.debug(u"removing observer for %s" % self.name)
             self._maildir.removeObserver(self.observer, self.name, "NEW_MESSAGE")
         self.maildir._removeBoxAccess(self.name, self, profile=self.profile)