Mercurial > libervia-backend
diff src/plugins/plugin_xep_0100.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 | 069ad98b360d |
children | 98f92a054539 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0100.py Thu Apr 16 13:31:14 2015 +0200 +++ b/src/plugins/plugin_xep_0100.py Thu Apr 16 14:57:57 2015 +0200 @@ -125,7 +125,7 @@ """ 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 @@ 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 @@ _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 @@ """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