Use u() functions to convert string for python2/3
This commit is contained in:
parent
634fc0c637
commit
ef13a1ede5
@ -1033,13 +1033,10 @@ class MainWindow(QMainWindow, WindowMixin):
|
|||||||
def openFile(self, _value=False):
|
def openFile(self, _value=False):
|
||||||
if not self.mayContinue():
|
if not self.mayContinue():
|
||||||
return
|
return
|
||||||
path = os.path.dirname(str(self.filePath))\
|
path = os.path.dirname(u(self.filePath)) if self.filePath else '.'
|
||||||
if self.filePath else '.'
|
|
||||||
formats = ['*.%s' % fmt.data().decode("ascii").lower() for fmt in QImageReader.supportedImageFormats()]
|
formats = ['*.%s' % fmt.data().decode("ascii").lower() for fmt in QImageReader.supportedImageFormats()]
|
||||||
filters = "Image & Label files (%s)" % \
|
filters = "Image & Label files (%s)" % ' '.join(formats + ['*%s' % LabelFile.suffix])
|
||||||
' '.join(formats + ['*%s' % LabelFile.suffix])
|
filename = QFileDialog.getOpenFileName(self, '%s - Choose Image or Label file' % __appname__, path, filters)
|
||||||
filename = QFileDialog.getOpenFileName(self,
|
|
||||||
'%s - Choose Image or Label file' % __appname__, path, filters)
|
|
||||||
if filename:
|
if filename:
|
||||||
if isinstance(filename, (tuple, list)):
|
if isinstance(filename, (tuple, list)):
|
||||||
filename = filename[0]
|
filename = filename[0]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user