core: fixed some logging calls without unicode strings, and use of print

This commit is contained in:
Goffi 2015-02-06 18:53:07 +01:00
commit d07237f49d

View file

@ -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: