From 13e1ab6c1489b25a31a626b2fc6775ed5eaa6fb8 Mon Sep 17 00:00:00 2001 From: blueblots <63152708+blueblots@users.noreply.github.com> Date: Mon, 15 Feb 2021 16:23:18 +0000 Subject: [PATCH] Changed logging strings, removed unnecessary return Removed `return None` from the `Rip.doCommand` method as suggested in review comments. Changed logging strings to use logger arguments rather than printf-string, as suggested in review comments. Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com> --- whipper/command/cd.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/whipper/command/cd.py b/whipper/command/cd.py index 2c87e98..ffd0067 100644 --- a/whipper/command/cd.py +++ b/whipper/command/cd.py @@ -485,13 +485,12 @@ Log files will log the path to tracks relative to this directory. logger.critical('giving up on track %d after %d times', number, tries) if self.options.keep_going: - logger.warning("track %d failed to rip. " - "Continuing to next track" % number) - logger.debug("adding %s to skipped_tracks" - % trackResult.filename) + logger.warning("track %d failed to rip.", number) + logger.debug("adding %s to skipped_tracks", + trackResult.filename) self.skipped_tracks.append(trackResult.filename) - logger.debug("skipped_tracks = %s" - % self.skipped_tracks) + logger.debug("skipped_tracks = %s", + self.skipped_tracks) trackResult.skipped = True logger.debug('trackResult.skipped = True') else: @@ -501,8 +500,7 @@ Log files will log the path to tracks relative to this directory. self.options.max_retries) if trackResult.filename in self.skipped_tracks: print("Skipping CRC comparison for track %d " - "due to rip failure" - % number) + "due to rip failure" % number) else: if trackResult.testcrc == trackResult.copycrc: logger.info('CRCs match for track %d', number) @@ -532,9 +530,9 @@ Log files will log the path to tracks relative to this directory. self.itable.getTrackStart(1), number) else: if trackResult.filename in self.skipped_tracks: - logger.debug("track %d (%s)" - "has been skipped; not adding to self.itable" - % (number, trackResult.filename)) + logger.debug("track %d (%s) has been skipped; " + "not adding to self.itable", + number, trackResult.filename) else: self.itable.setFile(number, 1, trackResult.filename, self.itable.getTrackLength(number), @@ -583,10 +581,9 @@ Log files will log the path to tracks relative to this directory. self.program.writeLog(discName, self.logger) if len(self.skipped_tracks) > 0: - logger.warning('%d tracks have been skipped from this rip attempt' - % len(self.skipped_tracks)) + logger.warning('%d tracks have been skipped from this rip attempt', + len(self.skipped_tracks)) return 5 - return None class CD(BaseCommand):