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

@ -96,7 +96,7 @@ class XEP_0096(object):
file_size = file_el["size"]
file_date = file_el.getAttribute("date", "")
file_hash = file_el.getAttribute("hash", "")
log.info(_("File proposed: name=[%(name)s] size=%(size)s") % {'name': filename, 'size': file_size})
log.info(_(u"File proposed: name=[%(name)s] size=%(size)s") % {'name': filename, 'size': file_size})
for file_child_el in file_el.elements():
if file_child_el.name == "desc":
file_desc = unicode(file_child_el)
@ -180,7 +180,7 @@ class XEP_0096(object):
misc_elts.append(range_elt)
self.host.plugins["XEP-0095"].acceptStream(data["id"], data['from'], feature_elt, misc_elts, profile)
else:
log.debug(_("Transfer [%s] refused") % sid)
log.debug(_(u"Transfer [%s] refused") % sid)
self.host.plugins["XEP-0095"].sendRejectedError(data["id"], data['from'], profile=profile)
del(client._xep_0096_waiting_for_approval[sid])
@ -198,7 +198,7 @@ class XEP_0096(object):
@param reason: can be TIMEOUT, IO_ERROR, PROTOCOL_ERROR"""
client = self.host.getClient(profile)
data, timeout, stream_method, failed_methods = client._xep_0096_waiting_for_approval[sid]
log.warning(_('Transfer %(id)s failed with stream method %(s_method)s: %(reason)s') % {
log.warning(_(u'Transfer %(id)s failed with stream method %(s_method)s: %(reason)s') % {
'id': sid,
's_method': stream_method,
'reason': reason})
@ -213,10 +213,10 @@ class XEP_0096(object):
if IQ['type'] == "error":
stanza_err = jabber.error.exceptionFromStanza(IQ)
if stanza_err.code == '403' and stanza_err.condition == 'forbidden':
log.debug(_("File transfer refused by %s") % IQ['from'])
log.debug(_(u"File transfer refused by %s") % IQ['from'])
self.host.bridge.newAlert(_("The contact %s refused your file") % IQ['from'], _("File refused"), "INFO", profile)
else:
log.warning(_("Error during file transfer with %s") % IQ['from'])
log.warning(_(u"Error during file transfer with %s") % IQ['from'])
self.host.bridge.newAlert(_("Something went wrong during the file transfer session intialisation with %s") % IQ['from'], _("File transfer error"), "ERROR", profile)
return
@ -289,10 +289,10 @@ class XEP_0096(object):
return sid
def sendSuccessCb(self, sid, file_obj, stream_method, profile):
log.info(_('Transfer %(sid)s successfuly finished [%(profile)s]')
log.info(_(u'Transfer %(sid)s successfuly finished [%(profile)s]')
% {"sid": sid, "profile": profile})
file_obj.close()
def sendFailureCb(self, sid, file_obj, stream_method, reason, profile):
file_obj.close()
log.warning(_('Transfer %(id)s failed with stream method %(s_method)s: %(reason)s [%(profile)s]') % {'id': sid, "s_method": stream_method, 'reason': reason, 'profile': profile})
log.warning(_(u'Transfer %(id)s failed with stream method %(s_method)s: %(reason)s [%(profile)s]') % {'id': sid, "s_method": stream_method, 'reason': reason, 'profile': profile})