def refresh_tools(self):
    self.tools_and_toolboxes = wbt.toolbox('')
    self.sort_tools_by_toolbox()
    self.get_tools_list()
    self.tool_tree.delete(*self.tool_tree.get_children())
    index = 0
    for toolbox in self.lower_toolboxes:
        if (toolbox.find('/') != (- 1)):
            self.tool_tree.insert(toolbox[:toolbox.find('/')], 0, text=('  ' + toolbox[(toolbox.find('/') + 1):]), iid=toolbox[(toolbox.find('/') + 1):], tags='toolbox', image=self.closed_toolbox_icon)
            for tool in self.sorted_tools[index]:
                self.tool_tree.insert(toolbox[(toolbox.find('/') + 1):], 'end', text=('  ' + tool), tags='tool', iid=tool, image=self.tool_icon)
        else:
            self.tool_tree.insert('', 'end', text=('  ' + toolbox), iid=toolbox, tags='toolbox', image=self.closed_toolbox_icon)
            for tool in self.sorted_tools[index]:
                self.tool_tree.insert(toolbox, 'end', text=('  ' + tool), iid=tool, tags='tool', image=self.tool_icon)
        index = (index + 1)
    self.tools_frame['text'] = '{} Available Tools'.format(len(self.tools_list))
def refresh_tools(self):
    self.tools_and_toolboxes = wbt.toolbox()
    self.sort_tools_by_toolbox()
    self.get_tools_list()
    self.tool_tree.delete(*self.tool_tree.get_children())
    index = 0
    for toolbox in self.lower_toolboxes:
        if (toolbox.find('/') != (- 1)):
            self.tool_tree.insert(toolbox[:toolbox.find('/')], 0, text=('  ' + toolbox[(toolbox.find('/') + 1):]), iid=toolbox[(toolbox.find('/') + 1):], tags='toolbox', image=self.closed_toolbox_icon)
            for tool in self.sorted_tools[index]:
                self.tool_tree.insert(toolbox[(toolbox.find('/') + 1):], 'end', text=('  ' + tool), tags='tool', iid=tool, image=self.tool_icon)
        else:
            self.tool_tree.insert(, 'end', text=('  ' + toolbox), iid=toolbox, tags='toolbox', image=self.closed_toolbox_icon)
            for tool in self.sorted_tools[index]:
                self.tool_tree.insert(toolbox, 'end', text=('  ' + tool), iid=tool, tags='tool', image=self.tool_icon)
        index = (index + 1)
    self.tools_frame['text'] = '{} Available Tools'.format(len(self.tools_list))