mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
Apply pyupgrade changes
This commit is contained in:
@@ -442,6 +442,6 @@ class DupeGuru(QObject):
|
||||
def select_dest_file(self, prompt, extension):
|
||||
files = tr("{} file (*.{})").format(extension.upper(), extension)
|
||||
destination, chosen_filter = QFileDialog.getSaveFileName(self.resultWindow, prompt, "", files)
|
||||
if not destination.endswith(".{}".format(extension)):
|
||||
destination = "{}.{}".format(destination, extension)
|
||||
if not destination.endswith(f".{extension}"):
|
||||
destination = f"{destination}.{extension}"
|
||||
return destination
|
||||
|
||||
@@ -347,7 +347,7 @@ class DirectoriesDialog(QMainWindow):
|
||||
destination, chosen_filter = QFileDialog.getSaveFileName(self, title, "", files)
|
||||
if destination:
|
||||
if not destination.endswith(".dupegurudirs"):
|
||||
destination = "{}.dupegurudirs".format(destination)
|
||||
destination = f"{destination}.dupegurudirs"
|
||||
self.app.model.save_directories_as(destination)
|
||||
|
||||
def scanButtonClicked(self):
|
||||
|
||||
@@ -22,7 +22,7 @@ class File(PhotoBase):
|
||||
return (size.width(), size.height())
|
||||
else:
|
||||
return (0, 0)
|
||||
except EnvironmentError:
|
||||
except OSError:
|
||||
logging.warning("Could not read image '%s'", str(self.path))
|
||||
return (0, 0)
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ class ResultWindow(QMainWindow):
|
||||
destination, chosen_filter = QFileDialog.getSaveFileName(self, title, "", files)
|
||||
if destination:
|
||||
if not destination.endswith(".dupeguru"):
|
||||
destination = "{}.dupeguru".format(destination)
|
||||
destination = f"{destination}.dupeguru"
|
||||
self.app.model.save_as(destination)
|
||||
self.app.recentResults.insertItem(destination)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user