From 0dba9987c5057e900b3da0be25ec9f2602aad583 Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 3 Aug 2024 07:19:53 +0000 Subject: [PATCH] sane-tag-media: remove unused "confirm" function --- .../additional/sane-scripts/src/sane-tag-media | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/additional/sane-scripts/src/sane-tag-media b/pkgs/additional/sane-scripts/src/sane-tag-media index 9fba76833..3af8f571c 100755 --- a/pkgs/additional/sane-scripts/src/sane-tag-media +++ b/pkgs/additional/sane-scripts/src/sane-tag-media @@ -915,9 +915,8 @@ class Tagger: self.show_tagdif(file_.path_, old_tags, new_tags) - if self.confirm(): - if self.guard_dry_run("writing tags"): - file_.write_tags(new_tags) + if self.guard_dry_run("writing tags"): + file_.write_tags(new_tags) def fix_path(self, file_: MediaFile) -> None: tags = self.tags_for(file_) @@ -932,11 +931,10 @@ class Tagger: self.show_pathdif(file_.path_, new_path) - if self.confirm(): - if self.guard_dry_run(f"moving file"): - assert not os.path.exists(new_path), f"{file_.path_} -> {new_path} would clobber destination!" - # os.renames creates the necessary parents, and then prunes leaf directories - os.renames(file_.path_, new_path) + if self.guard_dry_run(f"moving file"): + assert not os.path.exists(new_path), f"{file_.path_} -> {new_path} would clobber destination!" + # os.renames creates the necessary parents, and then prunes leaf directories + os.renames(file_.path_, new_path) def show_pathdif(self, old_path: str, new_path: str): logger.info( "updating path:") @@ -952,10 +950,6 @@ class Tagger: logger.debug(f"skipping unchanged {path_}") logger.debug(f" {tags}") - def confirm(self) -> bool: - # TODO: actually prompt - return True - def guard_dry_run(self, msg: str) -> bool: if self.dry_run: print(f"dry run: not {msg}")