Mercurial > libervia-web
diff src/browser/sat_browser/plugin_sec_otr.py @ 694:82123705474b
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:02 +0200 |
parents | 9877607c719a |
children | f8a7a046ff9c |
line wrap: on
line diff
--- a/src/browser/sat_browser/plugin_sec_otr.py Thu Apr 16 13:29:26 2015 +0200 +++ b/src/browser/sat_browser/plugin_sec_otr.py Thu Apr 16 14:57:02 2015 +0200 @@ -160,8 +160,8 @@ def receiveMessageCb(self, msg, encrypted): assert isinstance(self.peer, jid.JID) if not encrypted: - log.warning("A plain-text message has been handled by otr.js") - log.debug("message received (was %s): %s" % ('encrypted' if encrypted else 'plain', msg)) + log.warning(u"A plain-text message has been handled by otr.js") + log.debug(u"message received (was %s): %s" % ('encrypted' if encrypted else 'plain', msg)) if not encrypted: if self.state == otr.context.STATE_ENCRYPTED: log.warning(u"Received unencrypted message in an encrypted context (from %(jid)s)" % {'jid': self.peer}) @@ -170,11 +170,11 @@ def sendMessageCb(self, msg, meta=None): assert isinstance(self.peer, jid.JID) - log.debug("message to send%s: %s" % ((' (attached meta data: %s)' % meta) if meta else '', msg)) + log.debug(u"message to send%s: %s" % ((' (attached meta data: %s)' % meta) if meta else '', msg)) self.host.bridge.call('sendMessage', (None, self.host.sendError), unicode(self.peer), msg, '', C.MESS_TYPE_CHAT, {'send_only': 'true'}) def messageErrorCb(self, error): - log.error('error occured: %s' % error) + log.error(u'error occured: %s' % error) def setStateCb(self, msg_state, status): if status == otr.context.STATUS_AKE_INIT: @@ -202,7 +202,7 @@ self.host.newMessageHandler(unicode(self.peer), feedback.format(jid=other_jid_s), C.MESS_TYPE_INFO, unicode(self.host.whoami), {'header_info': OTR.getInfoText(msg_state, trust)}) def setCurrentTrust(self, new_trust='', act='asked', type_='trust'): - log.debug("setCurrentTrust: trust={trust}, act={act}, type={type}".format(type=type_, trust=new_trust, act=act)) + log.debug(u"setCurrentTrust: trust={trust}, act={act}, type={type}".format(type=type_, trust=new_trust, act=act)) title = (AUTH_OTHER_TITLE if act == "asked" else AUTH_US_TITLE).format(jid=self.peer) old_trust = self.getCurrentTrust() if type_ == 'abort': @@ -255,7 +255,7 @@ - a boolean value telling if the authentication succeed when type_ is 'trust' @param act (unicode): a value in ('asked', 'answered') """ - log.debug("smpAuthCb: type={type}, data={data}, act={act}".format(type=type_, data=data, act=act)) + log.debug(u"smpAuthCb: type={type}, data={data}, act={act}".format(type=type_, data=data, act=act)) if act is None: if type_ == 'question': act = 'answered' # OTR._authenticate calls this method with act="asked"