diff --git a/src/vai_lab/Data/xml_handler.py b/src/vai_lab/Data/xml_handler.py index 9c0a62c4..bf8c8119 100644 --- a/src/vai_lab/Data/xml_handler.py +++ b/src/vai_lab/Data/xml_handler.py @@ -526,14 +526,14 @@ def _add_options(self, option_text = ("\n{}".format( "\n".join([*options[key]]))) new_option.text = option_text - elif isinstance(options[key], (int, float, str)): + elif isinstance(options[key], (int, float, str)) or options[key] is None: new_option = opt_elem.find(str("./" + key)) if new_option is None: new_option = ET.SubElement(opt_elem, key) text_lead = "\n" if "\n" not in str(options[key]) else "" new_option.text = "{0} {1}".format( text_lead, str(options[key])) - elif isinstance(options[key], (dict)): + elif isinstance(options[key], dict): self._add_options(opt_elem, options[key]) def append_input_data(self, diff --git a/src/vai_lab/utils/plugins/pluginCanvas.py b/src/vai_lab/utils/plugins/pluginCanvas.py index 62dd8e54..20ddc9d4 100644 --- a/src/vai_lab/utils/plugins/pluginCanvas.py +++ b/src/vai_lab/utils/plugins/pluginCanvas.py @@ -749,9 +749,7 @@ def OnDoubleClick(self, event): self.entry = tk.Entry(self.tree, justify='center') if int(self.treecol[1:]) > 0: value = self.tree.item(self.treerow)['values'][int(str(self.treecol[1:]))-1] - value = str(value) if str(value) not in ['default', 'Choose X or Y'] else '' self.entry.insert(0, value) - # self.entry['selectbackground'] = '#123456' self.entry['exportselection'] = False self.entry.focus_force() @@ -780,14 +778,13 @@ def on_changeOption(self, *args): """ Executed when the optionmenu is selected and pressed enter. Saves the value""" if hasattr(self, 'dropDown'): - value = self.tree.item(self.treerow)['values'][int(str(self.treecol[1:]))-2] tags = self.tree.item(self.treerow)["tags"] val = self.tree.item(self.treerow)['values'] new_val = self.method_inputData['_'.join(tags[:-1])].get() val[int(self.treecol[1:])-1] = new_val self.tree.item(self.treerow, values=tuple([val[0], new_val])) self.dropDown.destroy() - self.saved = False + self.saved = False def on_return(self, event): """ Executed when the entry is edited and pressed enter. @@ -903,7 +900,7 @@ def updateSettings(self, tag, f, key, value = None): value = self.str_to_bool(value) if tag == 'req': - if value is not None or self.isNotClose(self.req_settings[f][key], value): + if self.isNotClose(self.req_settings[f][key], value): self.req_settings[f][key] = value else: self.req_settings[f].pop(key, None)