massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions

This commit is contained in:
souliane 2015-04-16 14:57:57 +02:00
commit 67ff77e5de

View file

@ -84,7 +84,7 @@ class SatXMPPClient(client.XMPPClient):
disco_d.addCallback(finish_connection)
def initializationFailed(self, reason):
log.error(_("ERROR: XMPP connection failed for profile '%(profile)s': %(reason)s" % {'profile': self.profile, 'reason': reason}))
log.error(_(u"ERROR: XMPP connection failed for profile '%(profile)s': %(reason)s" % {'profile': self.profile, 'reason': reason}))
self.conn_deferred.errback(reason.value)
try:
client.XMPPClient.initializationFailed(self, reason)
@ -251,7 +251,7 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
try:
item = self._jids.pop(entity)
except KeyError:
log.error("Received a roster remove event for an item not in cache ({})".format(entity))
log.error(u"Received a roster remove event for an item not in cache ({})".format(entity))
return
for group in item.groups:
try:
@ -260,7 +260,7 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
if not jids_set:
del self._groups[group]
except KeyError:
log.warning("there is no cache for the group [%(group)s] of the removed roster item [%(jid)s]" %
log.warning(u"there is no cache for the group [%(group)s] of the removed roster item [%(jid)s]" %
{"group": group, "jid": entity})
# then we send the bridge signal
@ -309,7 +309,7 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
super(SatPresenceProtocol, self).send(obj)
def availableReceived(self, entity, show=None, statuses=None, priority=0):
log.debug(_("presence update for [%(entity)s] (available, show=%(show)s statuses=%(statuses)s priority=%(priority)d)") % {'entity': entity, C.PRESENCE_SHOW: show, C.PRESENCE_STATUSES: statuses, C.PRESENCE_PRIORITY: priority})
log.debug(_(u"presence update for [%(entity)s] (available, show=%(show)s statuses=%(statuses)s priority=%(priority)d)") % {'entity': entity, C.PRESENCE_SHOW: show, C.PRESENCE_STATUSES: statuses, C.PRESENCE_PRIORITY: priority})
if not statuses:
statuses = {}
@ -328,7 +328,7 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
self.parent.profile)
def unavailableReceived(self, entity, statuses=None):
log.debug(_("presence update for [%(entity)s] (unavailable, statuses=%(statuses)s)") % {'entity': entity, C.PRESENCE_STATUSES: statuses})
log.debug(_(u"presence update for [%(entity)s] (unavailable, statuses=%(statuses)s)") % {'entity': entity, C.PRESENCE_STATUSES: statuses})
if not statuses:
statuses = {}
@ -384,15 +384,15 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile)
def subscribedReceived(self, entity):
log.debug(_("subscription approved for [%s]") % entity.userhost())
log.debug(_(u"subscription approved for [%s]") % entity.userhost())
self.host.bridge.subscribe('subscribed', entity.userhost(), self.parent.profile)
def unsubscribedReceived(self, entity):
log.debug(_("unsubscription confirmed for [%s]") % entity.userhost())
log.debug(_(u"unsubscription confirmed for [%s]") % entity.userhost())
self.host.bridge.subscribe('unsubscribed', entity.userhost(), self.parent.profile)
def subscribeReceived(self, entity):
log.debug(_("subscription request from [%s]") % entity.userhost())
log.debug(_(u"subscription request from [%s]") % entity.userhost())
item = self.parent.roster.getItem(entity)
if item and item.subscriptionTo:
# We automatically accept subscription if we are already subscribed to contact presence
@ -403,7 +403,7 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
self.host.bridge.subscribe('subscribe', entity.userhost(), self.parent.profile)
def unsubscribeReceived(self, entity):
log.debug(_("unsubscription asked for [%s]") % entity.userhost())
log.debug(_(u"unsubscription asked for [%s]") % entity.userhost())
item = self.parent.roster.getItem(entity)
if item and item.subscriptionFrom: # we automatically remove contact
log.debug(_('automatic contact deletion'))
@ -438,10 +438,10 @@ class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
self.user_email = email
self.deferred = deferred
self.profile = profile
log.debug(_("Registration asked for %(user)s@%(host)s") % {'user': user_login, 'host': jabber_host})
log.debug(_(u"Registration asked for %(user)s@%(host)s") % {'user': user_login, 'host': jabber_host})
def connectionMade(self):
log.debug(_("Connection made with %s" % self.jabber_host))
log.debug(_(u"Connection made with %s" % self.jabber_host))
self.xmlstream.namespace = "jabber:client"
self.xmlstream.sendHeader()
@ -459,11 +459,11 @@ class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
d.chainDeferred(self.deferred)
def registrationAnswer(self, answer):
log.debug(_("Registration answer: %s") % answer.toXml())
log.debug(_(u"Registration answer: %s") % answer.toXml())
self.xmlstream.sendFooter()
def registrationFailure(self, failure):
log.info(_("Registration failure: %s") % str(failure.value))
log.info(_("Registration failure: %s") % unicode(failure.value))
self.xmlstream.sendFooter()
raise failure.value