Path: Fix relative paths for bit path attributes in library files

This commit is contained in:
Russell Johnson
2021-07-05 14:45:12 -05:00
parent 71f8007bab
commit aec0bb1329

View File

@@ -632,9 +632,13 @@ class ToolBitLibrary(object):
toolNr = self.toolModel.data(self.toolModel.index(row, 0), PySide.QtCore.Qt.EditRole)
toolPath = self.toolModel.data(self.toolModel.index(row, 0), _PathRole)
if PathPreferences.toolsStoreAbsolutePaths():
tools.append({'nr': toolNr, 'path': toolPath})
bitPath = toolPath
else:
tools.append({'nr': toolNr, 'path': PathToolBit.findRelativePathTool(toolPath)})
# bitPath = PathToolBit.findRelativePathTool(toolPath)
# Extract the name of the shape file
__, filShp = os.path.split(toolPath) # __ is an ignored placeholder acknowledged by LGTM
bitPath = str(filShp)
tools.append({'nr': toolNr, 'path': bitPath})
if self.path is not None:
with open(self.path, 'w') as fp: