From 6fd7a782221210d0180be7e3cd8aff44f01aa058 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Sat, 8 Feb 2020 17:51:29 +0000 Subject: [PATCH] Change dest name of '--cover-art' option to 'cover_art' Make it consistent with the name of the option. Fixes #465. Signed-off-by: JoeLametta --- whipper/command/cd.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/whipper/command/cd.py b/whipper/command/cd.py index 6ae78e4..daa11f0 100644 --- a/whipper/command/cd.py +++ b/whipper/command/cd.py @@ -292,7 +292,7 @@ Log files will log the path to tracks relative to this directory. "the disc is a CD-R", default=False) self.parser.add_argument('-C', '--cover-art', - action="store", dest="fetch_cover_art", + action="store", dest="cover_art", help="fetch cover art and save it as " "standalone file, embed into FLAC files " "or perform both actions: file, embed, " @@ -368,12 +368,12 @@ Log files will log the path to tracks relative to this directory. os.makedirs(dirname) self.coverArtPath = None - if (self.options.fetch_cover_art in {"embed", "complete"} and + if (self.options.cover_art in {"embed", "complete"} and importlib.util.find_spec("PIL") is None): logger.warning("the cover art option '%s' won't be honored " "because the 'pillow' module isn't available", - self.options.fetch_cover_art) - elif self.options.fetch_cover_art in {"file", "embed", "complete"}: + self.options.cover_art) + elif self.options.cover_art in {"file", "embed", "complete"}: if getattr(self.program.metadata, "mbid", None) is not None: self.coverArtPath = self.program.getCoverArt( dirname, @@ -381,8 +381,8 @@ Log files will log the path to tracks relative to this directory. else: logger.warning("the cover art option '%s' won't be honored " "because disc metadata isn't available", - self.options.fetch_cover_art) - if self.options.fetch_cover_art == "file": + self.options.cover_art) + if self.options.cover_art == "file": self.coverArtPath = None # NOTE: avoid image embedding (hacky) # FIXME: turn this into a method @@ -523,7 +523,7 @@ Log files will log the path to tracks relative to this directory. # would be more appropriate, since otherwise this would potentially # leave stray files lying around in case of crashes etc. # - if (self.options.fetch_cover_art == "embed" and + if (self.options.cover_art == "embed" and self.coverArtPath is not None): logger.debug('deleting cover art file at: %r', self.coverArtPath) os.remove(self.coverArtPath)