Mercurial > libervia-backend
diff src/plugins/plugin_xep_0277.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 | be2df1ddea8e |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py Thu Apr 16 13:31:14 2015 +0200 +++ b/src/plugins/plugin_xep_0277.py Thu Apr 16 14:57:57 2015 +0200 @@ -129,13 +129,13 @@ # or defer.returnValue(Exception), it will explode and then the normal callback is ran. if item.uri not in (NS_PUBSUB, NS_PUBSUB + "#event"): - log.error(_("Unsupported namespace {ns} in pubsub item {id}").format(ns=item.uri, id=item_id)) + log.error(_(u"Unsupported namespace {ns} in pubsub item {id}").format(ns=item.uri, id=item_id)) defer.returnValue(exceptions.DataError()) try: entry_elt = xpath(item_elt, 'entry')[0] except IndexError: - log.error(_('No atom entry found in the pubsub item %s') % item_id) + log.error(_(u'No atom entry found in the pubsub item %s') % item_id) defer.returnValue(exceptions.DataError()) microblog_data = {} @@ -159,7 +159,7 @@ microblog_data['updated'] = date2float(entry_elt, 'updated') assert('title' in microblog_data) # has been processed already except IndexError: - log.error(_("Atom entry of pubsub item %s misses a required element") % item_id) + log.error(_(u"Atom entry of pubsub item %s misses a required element") % item_id) defer.returnValue(exceptions.DataError()) if 'content' not in microblog_data: # use the atom title data as the microblog body content @@ -185,7 +185,7 @@ microblog_data['comments_service'] = service.full() microblog_data['comments_node'] = node except (exceptions.DataError, RuntimeError, KeyError): - log.warning(_("Can't parse the link element of atom entry %s") % microblog_data['id']) + log.warning(_(u"Can't parse the link element of atom entry %s") % microblog_data['id']) except: pass try: @@ -194,7 +194,7 @@ try: # XXX: workaround for Jappix behaviour microblog_data['author'] = xpath(entry_elt, 'author/nick')[0].text except IndexError: - log.warning(_("Can't find author element in atom entry %s") % microblog_data['id']) + log.warning(_(u"Can't find author element in atom entry %s") % microblog_data['id']) defer.returnValue(microblog_data) @@ -339,7 +339,7 @@ def cb(result): #Node is created with right permission - log.debug(_("Microblog node has now access %s") % access) + log.debug(_(u"Microblog node has now access %s") % access) def fatal_err(s_error): #Something went wrong