diff src/plugins/plugin_xep_0115.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 e0bde0d0b321
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0115.py	Thu Apr 16 13:31:14 2015 +0200
+++ b/src/plugins/plugin_xep_0115.py	Thu Apr 16 14:57:57 2015 +0200
@@ -140,28 +140,28 @@
             c_hash = c_elem['hash']
             c_node = c_elem['node']
         except KeyError:
-            log.warning(_('Received invalid capabilities tag: %s') % c_elem.toXml())
+            log.warning(_(u'Received invalid capabilities tag: %s') % c_elem.toXml())
             return
 
         if c_ver in self.host.memory.disco.hashes:
             # we already know the hash, we update the jid entity
-            log.debug ("hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()})
+            log.debug(u"hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()})
             self.host.memory.updateEntityData(from_jid, C.ENTITY_CAP_HASH, c_ver, profile_key=self.profile)
             return
 
         if c_hash != 'sha-1': # unknown hash method
-            log.warning(_('Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node})
+            log.warning(_(u'Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node})
 
         def cb(dummy):
             computed_hash = self.host.memory.getEntityDatum(from_jid, C.ENTITY_CAP_HASH, self.profile)
             if computed_hash != c_ver:
-                log.warning(_('Computed hash differ from given hash:\ngiven: [%(given_hash)s]\ncomputed: [%(computed_hash)s]\n(entity: %(jid)s, node: %(node)s)') % {'given_hash':c_ver, 'computed_hash': computed_hash, 'jid': from_jid, 'node': c_node})
+                log.warning(_(u'Computed hash differ from given hash:\ngiven: [%(given_hash)s]\ncomputed: [%(computed_hash)s]\n(entity: %(jid)s, node: %(node)s)') % {'given_hash':c_ver, 'computed_hash': computed_hash, 'jid': from_jid, 'node': c_node})
 
         def eb(failure):
             if isinstance(failure.value, error.ConnectionDone):
                 return
             msg = failure.value.condition if hasattr(failure.value, 'condition') else failure.getErrorMessage()
-            log.error(_("Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg))
+            log.error(_(u"Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg))
 
         d = self.host.getDiscoInfos(from_jid, self.profile)
         d.addCallbacks(cb, eb)