From 2a04d556a387f4745846c0e020bfbadc97dc2d94 Mon Sep 17 00:00:00 2001 From: souliane Date: Wed, 4 Jun 2014 12:57:49 +0200 Subject: [PATCH] plugin XEP-0100: fixes the call to log.debug (line 185) --- src/plugins/plugin_xep_0100.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/plugins/plugin_xep_0100.py b/src/plugins/plugin_xep_0100.py index 79928b2a..b74e2a84 100755 --- a/src/plugins/plugin_xep_0100.py +++ b/src/plugins/plugin_xep_0100.py @@ -39,17 +39,17 @@ PLUGIN_INFO = { 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 @@ class XEP_0100(object): 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 @@ class XEP_0100(object): 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 @@ class XEP_0100(object): _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 @@ class XEP_0100(object): 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