changeset 1299:3360074a2f00 frontends_multi_profiles

core: fixed some logging calls without unicode strings, and use of print
author Goffi <goffi@goffi.org>
date Fri, 06 Feb 2015 18:53:07 +0100
parents e2f71b715708
children ba73798317a7
files src/core/xmpp.py
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/xmpp.py	Fri Feb 06 18:46:26 2015 +0100
+++ b/src/core/xmpp.py	Fri Feb 06 18:53:07 2015 +0100
@@ -187,10 +187,9 @@
         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 @@
             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 @@
 
     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: