massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
This commit is contained in:
parent
cc829beac7
commit
67ff77e5de
1 changed files with 272 additions and 271 deletions
|
|
@ -128,7 +128,7 @@ class MaildirBox(object):
|
|||
@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 @@ class MaildirBox(object):
|
|||
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 @@ class MaildirBox(object):
|
|||
@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 @@ class MailboxUser(object):
|
|||
@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 @@ class MailboxUser(object):
|
|||
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 @@ class MailboxUser(object):
|
|||
|
||||
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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue