From d07237f49d41007f17f9cc4d0a2f7d94a5caad23 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 6 Feb 2015 18:53:07 +0100 Subject: [PATCH] core: fixed some logging calls without unicode strings, and use of print --- src/core/xmpp.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/xmpp.py b/src/core/xmpp.py index 1160a1ba..0bbaec2e 100644 --- a/src/core/xmpp.py +++ b/src/core/xmpp.py @@ -187,10 +187,9 @@ class SatRosterProtocol(xmppim.RosterClientProtocol): item must be already registered in self._jids before this method is called @param item (RosterIem): item added """ - log.debug("registering item: {}".format(item.jid.full())) + log.debug(u"registering item: {}".format(item.jid.full())) if item.entity.resource: - log.warning("Received a roster item with a resource, this is not common but not restricted by RFC 6121, this case may be not well tested.") - import ipdb; ipdb.set_trace() + log.warning(u"Received a roster item with a resource, this is not common but not restricted by RFC 6121, this case may be not well tested.") if not item.subscriptionTo and not item.subscriptionFrom and not item.ask: #XXX: current behaviour: we don't want contact in our roster list # if there is no presence subscription @@ -199,12 +198,11 @@ class SatRosterProtocol(xmppim.RosterClientProtocol): return if not item.subscriptionTo: if not item.subscriptionFrom: - log.info(_("There's no subscription between you and [{}]!").format(item.jid.full())) + log.info(_(u"There's no subscription between you and [{}]!").format(item.jid.full())) else: - log.info(_("You are not subscribed to [{}]!").format(item.jid.full())) + log.info(_(u"You are not subscribed to [{}]!").format(item.jid.full())) if not item.subscriptionFrom: - log.info(_("[{}] is not subscribed to you!").format(item.jid.full())) - #self.host.memory.addContact(item.jid, item_attr, item.groups, self.parent.profile) + log.info(_(u"[{}] is not subscribed to you!").format(item.jid.full())) for group in item.groups: self._groups.setdefault(group, set()).add(item.entity) @@ -242,7 +240,7 @@ class SatRosterProtocol(xmppim.RosterClientProtocol): def removeReceived(self, request): entity = request.item.entity - print _("removing %s from roster list") % entity.full() + log.info(u"removing %s from roster list" % entity.full()) # we first remove item from local cache (self._groups and self._jids) try: