comparison sat/tools/xml_tools.py @ 4041:2594e1951cf7

core (bridge): `action_new` now use serialised dict for extra data.
author Goffi <goffi@goffi.org>
date Mon, 15 May 2023 16:20:45 +0200
parents 524856bd7b19
children
comparison
equal deleted inserted replaced
4040:1f967f85fc23 4041:2594e1951cf7
1753 profile=profile, 1753 profile=profile,
1754 ) 1754 )
1755 return xmlui_d 1755 return xmlui_d
1756 1756
1757 1757
1758 def defer_dialog(host, message, title="Please confirm", type_=C.XMLUI_DIALOG_CONFIRM, 1758 def defer_dialog(
1759 options=None, action_extra=None, security_limit=C.NO_SECURITY_LIMIT, chained=False, 1759 host,
1760 profile=C.PROF_KEY_NONE): 1760 message: str,
1761 title: str = "Please confirm",
1762 type_: str = C.XMLUI_DIALOG_CONFIRM,
1763 options: Optional[dict] = None,
1764 action_extra: Optional[dict] = None,
1765 security_limit: int = C.NO_SECURITY_LIMIT,
1766 chained: bool = False,
1767 profile: str = C.PROF_KEY_NONE
1768 ) -> defer.Deferred:
1761 """Create a submitable dialog and manage it with a deferred 1769 """Create a submitable dialog and manage it with a deferred
1762 1770
1763 @param message(unicode): message to display 1771 @param message: message to display
1764 @param title(unicode): title of the dialog 1772 @param title: title of the dialog
1765 @param type(unicode): dialog type (C.XMLUI_DIALOG_*) 1773 @param type: dialog type (C.XMLUI_DIALOG_* or plugin specific string)
1766 @param options(None, dict): if not None, will be used to update (extend) dialog_opt 1774 @param options: if not None, will be used to update (extend) dialog_opt arguments of
1767 arguments of XMLUI 1775 XMLUI
1768 @param action_extra(None, dict): extra action to merge with xmlui 1776 @param action_extra: extra action to merge with xmlui
1769 mainly used to add meta informations (see action_new doc) 1777 mainly used to add meta informations (see action_new doc)
1770 @param security_limit: %(doc_security_limit)s 1778 @param security_limit: %(doc_security_limit)s
1771 @param chained(bool): True if the Deferred result must be returned to the frontend 1779 @param chained: True if the Deferred result must be returned to the frontend
1772 useful when backend is in a series of dialogs with an ui 1780 useful when backend is in a series of dialogs with an ui
1773 @param profile: %(doc_profile)s 1781 @param profile: %(doc_profile)s
1774 @return (dict): Deferred dict 1782 @return: answer dict
1775 """ 1783 """
1776 assert profile is not None 1784 assert profile is not None
1777 dialog_opt = {"type": type_, "message": message} 1785 dialog_opt = {"type": type_, "message": message}
1778 if options is not None: 1786 if options is not None:
1779 dialog_opt.update(options) 1787 dialog_opt.update(options)