Browse Source

Consolidate property placement

Let the cmd_ui code itself place the properties that it later expects
to be present.

Potentially addresses issue observed in
https://github.com/datalad/datalad-gooey/pull/165
Michael Hanke 1 year ago
parent
commit
51ed295bc7
2 changed files with 3 additions and 3 deletions
  1. 3 0
      datalad_gooey/dataladcmd_ui.py
  2. 0 3
      datalad_gooey/param_form_utils.py

+ 3 - 0
datalad_gooey/dataladcmd_ui.py

@@ -101,6 +101,9 @@ class GooeyDataladCmdUI(QObject):
             get_cmd_displayname(api, cmdname).replace('&', '')
         )
         self._cmd_title.setToolTip(f'API command: `{cmdname}`')
+        # deposit the command name in the widget, to be retrieved later by
+        # retrieve_parameters()
+        self.pform.datalad_cmd_name = cmdname
         # make sure the UI is visible
         self.pwidget.setEnabled(True)
 

+ 0 - 3
datalad_gooey/param_form_utils.py

@@ -47,9 +47,6 @@ def populate_form_w_params(
     # localize to potentially delay heavy import
     from datalad import api as dlapi
 
-    # deposit the command name in the widget, to be retrieved later by
-    # retrieve_parameters()
-    formlayout.datalad_cmd_name = cmdname
     # get the matching callable from the DataLad API
     cmd = getattr(dlapi, cmdname)
     cmd_api_spec = api.get(cmdname, {})