bugfix: can not load xml with multiple dots file name such as xxx.xxx.xxx

This commit is contained in:
xunchangqing 2016-03-25 09:48:53 +08:00
parent f6663a6327
commit 83048cee65

View File

@ -706,8 +706,9 @@ class MainWindow(QMainWindow, WindowMixin):
## Label xml file and show bound box according to its filename ## Label xml file and show bound box according to its filename
if self.usingPascalVocFormat is True and \ if self.usingPascalVocFormat is True and \
self.defaultSaveDir is not None: self.defaultSaveDir is not None:
basename = os.path.basename(self.filename).split('.')[:-1][0] basename = os.path.basename(os.path.splitext(self.filename)[0])
xmlPath = os.path.join(self.defaultSaveDir, basename + '.xml') xmlPath = os.path.join(self.defaultSaveDir, basename + '.xml')
print xmlPath
self.loadPascalXMLByFilename(xmlPath) self.loadPascalXMLByFilename(xmlPath)
return True return True
@ -1039,6 +1040,7 @@ class MainWindow(QMainWindow, WindowMixin):
if self.filename is None: if self.filename is None:
return return
if os.path.exists(filename) is False: if os.path.exists(filename) is False:
print filename + ': xml not exist'
return return
tVocParseReader = PascalVocReader(filename) tVocParseReader = PascalVocReader(filename)