Fix filename bug

If the file name contains ".", it will go wrong.  e.g. hello.world.jpg --> hello.xml
This commit is contained in:
Jiye Qian 2017-07-26 01:53:49 +08:00 committed by GitHub
parent 14edc88a64
commit a878ab83b7

View File

@ -945,7 +945,7 @@ class MainWindow(QMainWindow, WindowMixin):
xmlPath = os.path.join(self.defaultSaveDir, basename)
self.loadPascalXMLByFilename(xmlPath)
else:
xmlPath = filePath.split(".")[0] + XML_EXT
xmlPath = os.path.splitext(filePath)[0] + XML_EXT
if os.path.isfile(xmlPath):
self.loadPascalXMLByFilename(xmlPath)