comparison src/plugins/plugin_xep_0060.py @ 1246:8b891f9be183

core, plugins: improve a bit some log messages
author souliane <souliane@mailoo.org>
date Sat, 18 Oct 2014 16:28:37 +0200
parents b4a264915ea9
children 633fcd13a7dc
comparison
equal deleted inserted replaced
1245:84d06701f5c4 1246:8b891f9be183
175 profile, client = self.__getClientNProfile(profile_key, 'get items') 175 profile, client = self.__getClientNProfile(profile_key, 'get items')
176 found_nodes = yield self.listNodes(service, profile=profile) 176 found_nodes = yield self.listNodes(service, profile=profile)
177 d_dict = {} 177 d_dict = {}
178 for publisher, node in data.items(): 178 for publisher, node in data.items():
179 if node not in found_nodes: 179 if node not in found_nodes:
180 log.info("Skip the items retrieval for [{node}]: node doesn't exist".format(node=node)) 180 log.debug("Skip the items retrieval for [{node}]: node doesn't exist".format(node=node))
181 continue # avoid pubsub "item-not-found" error 181 continue # avoid pubsub "item-not-found" error
182 d_dict[publisher] = client.items(service, node, max_items, item_ids, sub_id, client.parent.jid) 182 d_dict[publisher] = client.items(service, node, max_items, item_ids, sub_id, client.parent.jid)
183 defer.returnValue(d_dict) 183 defer.returnValue(d_dict)
184 184
185 def getOptions(self, service, nodeIdentifier, subscriber, subscriptionIdentifier=None, profile_key=C.PROF_KEY_NONE): 185 def getOptions(self, service, nodeIdentifier, subscriber, subscriptionIdentifier=None, profile_key=C.PROF_KEY_NONE):
221 found_nodes = yield self.listNodes(service, profile=profile) 221 found_nodes = yield self.listNodes(service, profile=profile)
222 subscribed_nodes = yield self.listSubscribedNodes(service, profile=profile) 222 subscribed_nodes = yield self.listSubscribedNodes(service, profile=profile)
223 d_list = [] 223 d_list = []
224 for nodeIdentifier in (set(nodeIdentifiers) - set(subscribed_nodes)): 224 for nodeIdentifier in (set(nodeIdentifiers) - set(subscribed_nodes)):
225 if nodeIdentifier not in found_nodes: 225 if nodeIdentifier not in found_nodes:
226 log.info("Skip the subscription to [{node}]: node doesn't exist".format(node=nodeIdentifier)) 226 log.debug("Skip the subscription to [{node}]: node doesn't exist".format(node=nodeIdentifier))
227 continue # avoid sat-pubsub "SubscriptionExists" error 227 continue # avoid sat-pubsub "SubscriptionExists" error
228 d_list.append(client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options)) 228 d_list.append(client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options))
229 defer.returnValue(d_list) 229 defer.returnValue(d_list)
230 230
231 def subscriptions(self, service, nodeIdentifier='', profile_key=C.PROF_KEY_NONE): 231 def subscriptions(self, service, nodeIdentifier='', profile_key=C.PROF_KEY_NONE):