소스 검색

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 2 년 전
부모
커밋
51ed295bc7
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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('&', '')
             get_cmd_displayname(api, cmdname).replace('&', '')
         )
         )
         self._cmd_title.setToolTip(f'API command: `{cmdname}`')
         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
         # make sure the UI is visible
         self.pwidget.setEnabled(True)
         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
     # localize to potentially delay heavy import
     from datalad import api as dlapi
     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
     # get the matching callable from the DataLad API
     cmd = getattr(dlapi, cmdname)
     cmd = getattr(dlapi, cmdname)
     cmd_api_spec = api.get(cmdname, {})
     cmd_api_spec = api.get(cmdname, {})