3838 CONFIGURE_METHOD_STRING ,
3939 DESERIALIZE_DEFAULT_CONTENT_STRING ,
4040 DESERIALIZE_IDENTIFIER_CONTENT_STRING ,
41- GETIDENTIFIER_DEFAULT_CONTENT_STRING ,
42- GETIDENTIFIER_IDENTIFER_CONTENT_STRING ,
41+ GET_IDENTIFIER_DEFAULT_CONTENT_STRING ,
42+ GET_IDENTIFIER_IDENTIFIER_CONTENT_STRING ,
4343 IDENTIFIER_METHOD_STRING ,
4444 IMPORT_STRING ,
4545 INIT_METHOD_STRING ,
4949 SERIALIZE_DEFAULT_CONTENT_STRING ,
5050 SERIALIZE_IDENTIFIER_CONTENT_STRING ,
5151 SERIALIZE_METHOD_STRING ,
52- SETIDENTIFIER_DEFAULT_CONTENT_STRING ,
53- SETIDENTIFIER_IDENTIFER_CONTENT_STRING ,
52+ SET_IDENTIFIER_DEFAULT_CONTENT_STRING ,
53+ SET_IDENTIFIER_IDENTIFIER_CONTENT_STRING ,
5454 SETUP_PY_TEMPLATE ,
5555 STEP_PACKAGE_INIT_STRING ,
5656)
@@ -277,11 +277,11 @@ def _writeStep(self, step_dir):
277277 init_string += ' self._portData{0} = None # {1}\n ' .format (index , current_port [1 ])
278278
279279 if self ._options .hasIdentifierConfig ():
280- id_method_string = IDENTIFIER_METHOD_STRING .format (getidentifiercontent = GETIDENTIFIER_IDENTIFER_CONTENT_STRING ,
281- setidentifiercontent = SETIDENTIFIER_IDENTIFER_CONTENT_STRING )
280+ id_method_string = IDENTIFIER_METHOD_STRING .format (getidentifiercontent = GET_IDENTIFIER_IDENTIFIER_CONTENT_STRING ,
281+ setidentifiercontent = SET_IDENTIFIER_IDENTIFIER_CONTENT_STRING )
282282 else :
283- id_method_string = IDENTIFIER_METHOD_STRING .format (getidentifiercontent = GETIDENTIFIER_DEFAULT_CONTENT_STRING .format (step_object_name = object_name ),
284- setidentifiercontent = SETIDENTIFIER_DEFAULT_CONTENT_STRING )
283+ id_method_string = IDENTIFIER_METHOD_STRING .format (getidentifiercontent = GET_IDENTIFIER_DEFAULT_CONTENT_STRING .format (step_object_name = object_name ),
284+ setidentifiercontent = SET_IDENTIFIER_DEFAULT_CONTENT_STRING )
285285
286286 if self ._options .configCount () > 0 :
287287 init_string += ' # Config:\n '
@@ -394,14 +394,13 @@ def getConfig(self):
394394 \" \" \"
395395 Get the current value of the configuration from the dialog.{additional_comment}
396396 \" \" \" {previous_identifier}
397- config = {{}}
398397"""
399398 if self ._options .hasIdentifierConfig ():
400399 set_config_string = set_config_string .format (
401400 additional_comment = ' Also\n '
402401 ' set the _previousIdentifier value so that we can check uniqueness of the\n '
403402 ' identifier over the whole of the workflow.' ,
404- previous_identifier = '\n self._previousIdentifier = config[\' identifier \' ]' )
403+ previous_identifier = '\n self._previousIdentifier = config[\' Identifier \' ]' )
405404 get_config_string = get_config_string .format (
406405 additional_comment = ' Also\n '
407406 ' set the _previousIdentifier value so that we can check uniqueness of the\n '
@@ -412,16 +411,16 @@ def getConfig(self):
412411 get_config_string = get_config_string .format (additional_comment = '' , previous_identifier = '' )
413412
414413 row_index = 0
414+ config_key_item_string = ''
415415 while row_index < self ._options .configCount ():
416416 label = self ._options .getConfig (row_index )[0 ]
417417 widgets_string += CONFIGURE_DIALOG_LINE .format (row = row_index , label = label + ': ' )
418418 config = self ._options .getConfig (row_index )
419419 set_config_string += ' self._ui.lineEdit{0}.setText(config[\' {1}\' ])\n ' .format (row_index , config [0 ])
420- get_config_string += ' config[ \' {1}\' ] = self._ui.lineEdit{0}.text()\n ' .format (row_index , config [0 ])
420+ config_key_item_string += ' \' {1}\' : self._ui.lineEdit{0}.text(), \n ' .format (row_index , config [0 ])
421421 row_index += 1
422422
423- set_config_string += '\n '
424- get_config_string += ' return config\n '
423+ get_config_string += ' return {\n ' + config_key_item_string + ' }\n ' if config_key_item_string else ' return {}\n '
425424
426425 ui_file = os .path .join (qt_dir , QT_CONFDIALOG_UI_FILENAME )
427426 with open (ui_file , 'w' ) as fui :
0 commit comments