From ceef1c4842e3dece738ee338be54a7b13e2e257d Mon Sep 17 00:00:00 2001 From: Carlos Sevilla Salcedo Date: Mon, 16 Oct 2023 12:15:38 +0200 Subject: [PATCH] Check functions and methods. Fix dropdown check --- src/vai_lab/utils/plugins/pluginCanvas.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vai_lab/utils/plugins/pluginCanvas.py b/src/vai_lab/utils/plugins/pluginCanvas.py index 20ddc9d4..9895a433 100644 --- a/src/vai_lab/utils/plugins/pluginCanvas.py +++ b/src/vai_lab/utils/plugins/pluginCanvas.py @@ -514,7 +514,7 @@ def optionsWindow(self): # Find functions defined for the module plugin_meth_list = [meth[0] for meth in getmembers(plugin, isfunction) if meth[0][0] != '_'] # Find available methods for the model - model_meth_list = [meth[0] for meth in getmembers(self.model, ismethod) if meth[0][0] != '_'] + model_meth_list = [meth[0] for meth in getmembers(self.model, ismethod) + getmembers(self.model, isfunction) if meth[0][0] != '_'] # List intersection # TODO: use only methods from the model set_2 = frozenset(model_meth_list) @@ -522,7 +522,6 @@ def optionsWindow(self): except Exception as exc: meth_list = [] - self.meths_sort = [] self.method_inputData = {} self.default_inputData = {} @@ -540,8 +539,6 @@ def optionsWindow(self): 'resources', 'Assets', 'VAILabsIcon.ico')))) - # self.newWindow.geometry("350x400") - frame1 = tk.Frame(self.newWindow) frame2 = tk.Frame(self.newWindow) @@ -784,6 +781,7 @@ def on_changeOption(self, *args): val[int(self.treecol[1:])-1] = new_val self.tree.item(self.treerow, values=tuple([val[0], new_val])) self.dropDown.destroy() + self.__dict__.pop('dropDown',None) self.saved = False def on_return(self, event): @@ -851,6 +849,7 @@ def removewindow(self): val[int(self.treecol[1:])-1] = new_val self.tree.item(el, values=tuple([val[0], new_val])) self.dropDown.destroy() + self.__dict__.pop('dropDown',None) # Updates the modified options and removes the ones that are not for f in self.tree.get_children(): for c in self.tree.get_children(f):