changeset 1049:9e24ca275ddd

plugin XEP-0100: fixes the call to log.debug (line 185)
author souliane <souliane@mailoo.org>
date Wed, 04 Jun 2014 12:57:49 +0200
parents 3f3dbb4c4fcf
children de415d7984f7
files src/plugins/plugin_xep_0100.py
diffstat 1 files changed, 13 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0100.py	Wed May 28 12:14:28 2014 +0200
+++ b/src/plugins/plugin_xep_0100.py	Wed Jun 04 12:57:49 2014 +0200
@@ -39,17 +39,17 @@
 WARNING_MSG = D_(u"""Be careful ! Gateways allow you to use an external IM (legacy IM), so you can see your contact as XMPP contacts.
 But when you do this, all your messages go throught the external legacy IM server, it is a huge privacy issue (i.e.: all your messages throught the gateway can be monitored, recorded, analysed by the external server, most of time a private company).""")
 
-GATEWAY_TIMEOUT = 10 # time to wait before cancelling a gateway disco info, in seconds
+GATEWAY_TIMEOUT = 10  # time to wait before cancelling a gateway disco info, in seconds
 
-TYPE_DESCRIPTIONS = { 'irc': D_("Internet Relay Chat"),
-                      'xmpp': D_("XMPP"),
-                      'qq': D_("Tencent QQ"),
-                      'simple': D_("SIP/SIMPLE"),
-                      'icq': D_("ICQ"),
-                      'yahoo': D_("Yahoo! Messenger"),
-                      'gadu-gadu': D_("Gadu-Gadu"),
-                      'aim': D_("AOL Instant Messenger"),
-                      'msn': D_("Windows Live Messenger"),
+TYPE_DESCRIPTIONS = {'irc': D_("Internet Relay Chat"),
+                     'xmpp': D_("XMPP"),
+                     'qq': D_("Tencent QQ"),
+                     'simple': D_("SIP/SIMPLE"),
+                     'icq': D_("ICQ"),
+                     'yahoo': D_("Yahoo! Messenger"),
+                     'gadu-gadu': D_("Gadu-Gadu"),
+                     'aim': D_("AOL Instant Messenger"),
+                     'msn': D_("Windows Live Messenger"),
                     }
 
 
@@ -65,7 +65,6 @@
         self.__selected_id = host.registerCallback(self._gatewaySelectedCb, with_data=True)
         host.importMenu((D_("Service"), D_("gateways")), self._gatewaysMenu, security_limit=2, help_string=D_("Find gateways"))
 
-
     def _gatewaysMenu(self, data, profile):
         """ XMLUI activated by menu: return Gateways UI
         @param profile: %(doc_profile)s
@@ -168,7 +167,7 @@
                 entity = items[idx].entity
                 gateways = [(identity, result.identities[identity]) for identity in result.identities if identity[0] == 'gateway']
                 if gateways:
-                    log.info (_("Found gateway [%(jid)s]: %(identity_name)s") % {'jid': entity.full(), 'identity_name': ' - '.join([gateway[1] for gateway in gateways])})
+                    log.info(_("Found gateway [%(jid)s]: %(identity_name)s") % {'jid': entity.full(), 'identity_name': ' - '.join([gateway[1] for gateway in gateways])})
                     ret.append((success, (entity, gateways)))
                 else:
                     log.info(_("Skipping [%(jid)s] which is not a gateway") % {'jid': entity.full()})
@@ -183,14 +182,13 @@
 
         _defers = []
         for item in disco._items:
-            log.debug(_("item found: %s"), item.entity)
+            log.debug(_("item found: %s") % item.entity)
             _defers.append(client.disco.requestInfo(item.entity))
         dl = defer.DeferredList(_defers)
         dl.addCallback(self._infosReceived, items=disco._items, target=target, client=client)
         reactor.callLater(GATEWAY_TIMEOUT, dl.cancel)
         return dl
 
-
     def _findGateways(self, target_jid_s, profile_key):
         target_jid = jid.JID(target_jid_s)
         profile = self.host.memory.getProfileName(profile_key)
@@ -201,12 +199,11 @@
         d.addCallback(lambda xmlui: xmlui.toXml())
         return d
 
-
     def findGateways(self, target, profile):
         """Find gateways in the target JID, using discovery protocol
         """
         client = self.host.getClient(profile)
         log.debug(_("find gateways (target = %(target)s, profile = %(profile)s)") % {'target': target.full(), 'profile': profile})
         d = client.disco.requestItems(target)
-        d.addCallback(self._itemsReceived , target=target, client=client)
+        d.addCallback(self._itemsReceived, target=target, client=client)
         return d