diff 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
line wrap: on
line diff
--- a/sat/tools/xml_tools.py	Mon May 15 16:20:38 2023 +0200
+++ b/sat/tools/xml_tools.py	Mon May 15 16:20:45 2023 +0200
@@ -1755,23 +1755,31 @@
     return xmlui_d
 
 
-def defer_dialog(host, message, title="Please confirm", type_=C.XMLUI_DIALOG_CONFIRM,
-    options=None, action_extra=None, security_limit=C.NO_SECURITY_LIMIT, chained=False,
-    profile=C.PROF_KEY_NONE):
+def defer_dialog(
+    host,
+    message: str,
+    title: str = "Please confirm",
+    type_: str = C.XMLUI_DIALOG_CONFIRM,
+    options: Optional[dict] = None,
+    action_extra: Optional[dict] = None,
+    security_limit: int = C.NO_SECURITY_LIMIT,
+    chained: bool = False,
+    profile: str = C.PROF_KEY_NONE
+) -> defer.Deferred:
     """Create a submitable dialog and manage it with a deferred
 
-    @param message(unicode): message to display
-    @param title(unicode): title of the dialog
-    @param type(unicode): dialog type (C.XMLUI_DIALOG_*)
-    @param options(None, dict): if not None, will be used to update (extend) dialog_opt
-                                arguments of XMLUI
-    @param action_extra(None, dict): extra action to merge with xmlui
+    @param message: message to display
+    @param title: title of the dialog
+    @param type: dialog type (C.XMLUI_DIALOG_* or plugin specific string)
+    @param options: if not None, will be used to update (extend) dialog_opt arguments of
+        XMLUI
+    @param action_extra: extra action to merge with xmlui
         mainly used to add meta informations (see action_new doc)
     @param security_limit: %(doc_security_limit)s
-    @param chained(bool): True if the Deferred result must be returned to the frontend
+    @param chained: True if the Deferred result must be returned to the frontend
         useful when backend is in a series of dialogs with an ui
     @param profile: %(doc_profile)s
-    @return (dict): Deferred dict
+    @return: answer dict
     """
     assert profile is not None
     dialog_opt = {"type": type_, "message": message}