From f4f0435814540939ff0fab58865cc934991b2c7c Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Thu, 21 Jul 2011 10:41:25 +0200 Subject: [PATCH] Python 3 fixes --- sloth/gui/labeltool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sloth/gui/labeltool.py b/sloth/gui/labeltool.py index 216dee3..3906b5f 100755 --- a/sloth/gui/labeltool.py +++ b/sloth/gui/labeltool.py @@ -336,7 +336,7 @@ class MainWindow(QMainWindow): fname = QFileDialog.getOpenFileName(self, "%s - Load Annotations" % APP_NAME, path, "%s annotation files (%s)" % (APP_NAME, format_str)) - if not fname.isEmpty(): + if len(str(fname)) > 0: self.labeltool.loadAnnotations(fname) def fileSave(self): @@ -352,7 +352,7 @@ class MainWindow(QMainWindow): "%s - Save Annotations" % APP_NAME, fname, "%s annotation files (%s)" % (APP_NAME, format_str)) - if not fname.isEmpty(): + if len(str(fname)) > 0: return self.labeltool.saveAnnotations(str(fname)) return False @@ -367,7 +367,7 @@ class MainWindow(QMainWindow): format_str = ' '.join(image_types + video_types) fname = QFileDialog.getOpenFileName(self, "%s - Add Media File" % APP_NAME, path, "Media files (%s)" % (format_str, )) - if fname.isEmpty(): + if len(str(fname)) == 0: return fname = str(fname)