# HG changeset patch # User Goffi # Date 1473584605 -7200 # Node ID 58f0c96d60e55942ecc25ef4faadd8058ea1e260 # Parent 528e5fafc11b150b775ca16fd2c1256ba8b5c4c4 quick frontend (menus): minor docstring fixes diff -r 528e5fafc11b -r 58f0c96d60e5 frontends/src/quick_frontend/quick_menus.py --- a/frontends/src/quick_frontend/quick_menus.py Sat Sep 10 18:03:24 2016 +0200 +++ b/frontends/src/quick_frontend/quick_menus.py Sun Sep 11 11:03:25 2016 +0200 @@ -135,7 +135,7 @@ class MenuItemLocal(MenuItem): - """A MenuItem with a distant callback""" + """A MenuItem with a local callback""" CALLABLE=True def __init__(self, type_, name, name_i18n, callback, extra=None): @@ -143,7 +143,9 @@ @param type_(unicode): same as in [sat.core.sat_main.SAT.importMenu] @param name(unicode): canonical name of the item @param name_i18n(unicode): translated name of the item - @param callback(callable): local callback. Will be called with the caller as only argument if data_collector is None, else with the caller + requested data + profile. + @param callback(callable): local callback. + Will be called with no argument if data_collector is None + and with caller, profile, and requested data otherwise @param extra(dict[unicode, unicode], None): same as in [addMenus] """ MenuItem.__init__(self, name, name_i18n, extra, type_) @@ -152,6 +154,7 @@ def call(self, caller, profile=C.PROF_KEY_NONE): data_collector = QuickMenusManager.getDataCollector(self.type) if data_collector is None: + # FIXME: would not it be better if caller and profile where used as arguments? self.callback() else: self.callback(caller, self.collectData(caller), profile) @@ -310,7 +313,9 @@ A data collector is a method or a map which allow to collect context data to construct the dictionnary which will be sent to the bridge method managing the menu item. @param type_(unicode): same as in [sat.core.sat_main.SAT.importMenu] @param data_collector(dict[unicode,unicode], callable, None): can be: - - a dict which map data name to local name. The attribute named after the dict values will be getted from caller, and put in data. e.g.: if data_collector={'room_jid':'target'}, then the "room_jid" data will be the value of the "target" attribute of the caller. + - a dict which map data name to local name. + The attribute named after the dict values will be getted from caller, and put in data. + e.g.: if data_collector={'room_jid':'target'}, then the "room_jid" data will be the value of the "target" attribute of the caller. - a callable which must return the data dictionnary. callable will have caller and item name as argument - None: an empty dict will be used """