def toolBitExisting(self): filenames = PathToolBitGui.GetToolFiles() if len(filenames) == 0: return for f in filenames: loc, fil = os.path.split(f) fname = os.path.splitext(fil)[0] fullpath = "{}{}{}.fctb".format(loc, os.path.sep, fname) self.factory.newTool(self.toolModel, fullpath)
def toolAdd(self): PathLog.track() # pylint: disable=broad-except try: nr = 0 for row in range(self.model.rowCount()): itemNr = int(self.model.item(row, 0).data(PySide.QtCore.Qt.EditRole)) nr = max(nr, itemNr) nr += 1 for i, foo in enumerate(PathToolBitGui.GetToolFiles(self.form)): tool = PathToolBit.Declaration(foo) self._toolAdd(nr + i, tool, foo) self.toolTableView.resizeColumnsToContents() except Exception: PathLog.error('something happened') PathLog.error(traceback.print_exc())