Mercurial > libervia-backend
comparison src/plugins/plugin_sec_otr.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 | 364dcdae2bff |
comparison
equal
deleted
inserted
replaced
1408:8a7145138330 | 1409:3265a2639182 |
---|---|
153 | 153 |
154 def loadTrusts(self): | 154 def loadTrusts(self): |
155 trust_data = self.client.otr_data.get('trust', {}) | 155 trust_data = self.client.otr_data.get('trust', {}) |
156 for jid_, jid_data in trust_data.iteritems(): | 156 for jid_, jid_data in trust_data.iteritems(): |
157 for fingerprint, trust_level in jid_data.iteritems(): | 157 for fingerprint, trust_level in jid_data.iteritems(): |
158 log.debug('setting trust for {jid}: [{fingerprint}] = "{trust_level}"'.format(jid=jid_, fingerprint=fingerprint, trust_level=trust_level)) | 158 log.debug(u'setting trust for {jid}: [{fingerprint}] = "{trust_level}"'.format(jid=jid_, fingerprint=fingerprint, trust_level=trust_level)) |
159 self.trusts.setdefault(jid.JID(jid_), {})[fingerprint] = trust_level | 159 self.trusts.setdefault(jid.JID(jid_), {})[fingerprint] = trust_level |
160 | 160 |
161 def saveTrusts(self): | 161 def saveTrusts(self): |
162 log.debug("saving trusts for {profile}".format(profile=self.client.profile)) | 162 log.debug(u"saving trusts for {profile}".format(profile=self.client.profile)) |
163 log.debug("trusts = {}".format(self.client.otr_data['trust'])) | 163 log.debug(u"trusts = {}".format(self.client.otr_data['trust'])) |
164 self.client.otr_data.force('trust') | 164 self.client.otr_data.force('trust') |
165 | 165 |
166 def setTrust(self, other_jid, fingerprint, trustLevel): | 166 def setTrust(self, other_jid, fingerprint, trustLevel): |
167 try: | 167 try: |
168 trust_data = self.client.otr_data['trust'] | 168 trust_data = self.client.otr_data['trust'] |
187 return context | 187 return context |
188 | 188 |
189 def getContextForUser(self, other): | 189 def getContextForUser(self, other): |
190 log.debug(u"getContextForUser [%s]" % other) | 190 log.debug(u"getContextForUser [%s]" % other) |
191 if not other.resource: | 191 if not other.resource: |
192 log.warning("getContextForUser called with a bare jid: %s" % other.full()) | 192 log.warning(u"getContextForUser called with a bare jid: %s" % other.full()) |
193 return self.startContext(other) | 193 return self.startContext(other) |
194 | 194 |
195 | 195 |
196 class OTR(object): | 196 class OTR(object): |
197 | 197 |