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

@ -125,7 +125,7 @@ class XEP_0100(object):
"""
category, type_ = identity
if category != 'gateway':
log.error(_('INTERNAL ERROR: identity category should always be "gateway" in _getTypeString, got "%s"') % category)
log.error(_(u'INTERNAL ERROR: identity category should always be "gateway" in _getTypeString, got "%s"') % category)
try:
return _(TYPE_DESCRIPTIONS[type_])
except KeyError:
@ -167,10 +167,10 @@ class XEP_0100(object):
entity = items[idx].entity
gateways = [(identity, result.identities[identity]) for identity in result.identities if identity[0] == 'gateway']
if gateways:
log.info(_("Found gateway [%(jid)s]: %(identity_name)s") % {'jid': entity.full(), 'identity_name': ' - '.join([gateway[1] for gateway in gateways])})
log.info(_(u"Found gateway [%(jid)s]: %(identity_name)s") % {'jid': entity.full(), 'identity_name': ' - '.join([gateway[1] for gateway in gateways])})
ret.append((success, (entity, gateways)))
else:
log.info(_("Skipping [%(jid)s] which is not a gateway") % {'jid': entity.full()})
log.info(_(u"Skipping [%(jid)s] which is not a gateway") % {'jid': entity.full()})
return ret
def _itemsReceived(self, disco, target, client):
@ -182,7 +182,7 @@ class XEP_0100(object):
_defers = []
for item in disco._items:
log.debug(_("item found: %s") % item.entity)
log.debug(_(u"item found: %s") % item.entity)
_defers.append(client.disco.requestInfo(item.entity))
dl = defer.DeferredList(_defers)
dl.addCallback(self._infosReceived, items=disco._items, target=target, client=client)
@ -203,7 +203,7 @@ class XEP_0100(object):
"""Find gateways in the target JID, using discovery protocol
"""
client = self.host.getClient(profile)
log.debug(_("find gateways (target = %(target)s, profile = %(profile)s)") % {'target': target.full(), 'profile': profile})
log.debug(_(u"find gateways (target = %(target)s, profile = %(profile)s)") % {'target': target.full(), 'profile': profile})
d = client.disco.requestItems(target)
d.addCallback(self._itemsReceived, target=target, client=client)
return d