core (disco): use of “profile” instead of “profile_key” in several disco methods
This commit is contained in:
parent
083f426b24
commit
341143445b
1 changed files with 50 additions and 48 deletions
|
|
@ -27,7 +27,6 @@ from twisted.internet import defer
|
|||
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 @@ class XEP_0055(object):
|
|||
|
||||
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 @@ class XEP_0055(object):
|
|||
|
||||
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 @@ class XEP_0055(object):
|
|||
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 @@ class XEP_0055(object):
|
|||
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 @@ class XEP_0055(object):
|
|||
|
||||
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 @@ class XEP_0055(object):
|
|||
@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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue