diff src/plugins/plugin_xep_0055.py @ 1552:e0bde0d0b321

core (disco): use of “profile” instead of “profile_key” in several disco methods
author Goffi <goffi@goffi.org>
date Mon, 02 Nov 2015 22:02:41 +0100
parents 72e6ee3fdf53
children 94c450972346
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0055.py	Mon Nov 02 22:02:41 2015 +0100
+++ b/src/plugins/plugin_xep_0055.py	Mon Nov 02 22:02:41 2015 +0100
@@ -27,7 +27,6 @@
 from wokkel import data_form
 from sat.core.constants import Const as C
 from sat.core.exceptions import DataError
-from sat.memory.memory import Sessions
 from sat.tools import xml_tools
 
 from wokkel import disco, iwokkel
@@ -84,11 +83,11 @@
 
     def _getHostServices(self, profile):
         """Return the jabber search services associated to the user host.
-        
+
         @param profile (unicode): %(doc_profile)s
         @return: list[jid.JID]
         """
-        d = self.host.findFeaturesSet([NS_SEARCH], profile_key=profile)
+        d = self.host.findFeaturesSet([NS_SEARCH], profile=profile)
         return d.addCallback(lambda set_: list(set_))
 
 
@@ -125,7 +124,7 @@
 
     def _addSimpleSearchUI(self, services, main_ui, data, profile):
         """Add to the main UI a tab for the simple search.
-        
+
         Display a single input field and search on the main service (it actually does one search per search field and then compile the results).
 
         @param services (list[jid.JID]): search services offered by the user server
@@ -143,7 +142,7 @@
         sub_cont = main_ui.main_container.addTab("simple_search", label=_("Simple search"), container=xml_tools.VerticalContainer)
         main_ui.changeContainer(sub_cont.append(xml_tools.PairsContainer(main_ui)))
         xml_tools.dataForm2Widgets(main_ui, form)
-        
+
         # FIXME: add colspan attribute to divider? (we are in a PairsContainer)
         main_ui.addDivider('blank')
         main_ui.addDivider('blank')  # here we added a blank line before the button
@@ -243,7 +242,7 @@
             name = widget.getAttribute("name")
             if adv_data.get(name):
                 widget.setAttribute("value", adv_data[name])
-        
+
         # FIXME: add colspan attribute to divider? (we are in a PairsContainer)
         main_ui.addDivider('blank')
         main_ui.addDivider('blank')  # here we added a blank line before the button
@@ -267,11 +266,11 @@
 
     def _displaySearchResult(self, main_ui, elt):
         """Display the search results.
-        
+
         @param main_ui (XMLUI): the main XMLUI instance
         @param elt (domish.Element):  form result element
         """
-        if [child for child in elt.children if child.name == "item"]: 
+        if [child for child in elt.children if child.name == "item"]:
             headers, xmlui_data = xml_tools.dataFormResult2XMLUIData(elt)
             if "jid" in headers:  # use XMLUI JidsListWidget to display the results
                 values = {}
@@ -458,7 +457,7 @@
         @return: a deferred dict{unicode: unicode}
         """
         d = self._getHostServices(profile)
-        
+
         def got_services(services):
             service_jid = services[0]
             d = self.host.plugins["XEP-0050"].requestCommandsList(service_jid, profile)