From e124c79c64d93bb6d372de34ceb6bf226388f2e8 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 8 Apr 2010 21:06:52 +0000 Subject: [PATCH] * morituri/program/cdparanoia.py: Add some debug. * morituri/common/encode.py: Add more debug. Handle the case where peak is full scale, and peakdB thus 0, which triggered not setting self.peak. --- ChangeLog | 9 +++++++++ morituri/common/encode.py | 8 +++++++- morituri/program/cdparanoia.py | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ece9a19..b7a22e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-04-08 Thomas Vander Stichele + + * morituri/program/cdparanoia.py: + Add some debug. + * morituri/common/encode.py: + Add more debug. + Handle the case where peak is full scale, and peakdB thus 0, + which triggered not setting self.peak. + 2010-04-06 Thomas Vander Stichele patch by: Peter Oliver. diff --git a/morituri/common/encode.py b/morituri/common/encode.py index 5144f2e..d9660fb 100644 --- a/morituri/common/encode.py +++ b/morituri/common/encode.py @@ -123,6 +123,8 @@ class EncodeTask(task.Task): @type peak: float """ + logCategory = 'EncodeTask' + description = 'Encoding' peak = None @@ -244,6 +246,7 @@ class EncodeTask(task.Task): for p in s['peak']: if self._peakdB < p: + self.log('higher peakdB found, now %r', self._peakdB) self._peakdB = p def stop(self): @@ -256,5 +259,8 @@ class EncodeTask(task.Task): self.debug('set state to NULL') task.Task.stop(self) - if self._peakdB: + if self._peakdB is not None: + self.debug('peakdB %r', self._peakdB) self.peak = math.sqrt(math.pow(10, self._peakdB / 10.0)) + else: + self.warning('No peak found, something went wrong!') diff --git a/morituri/program/cdparanoia.py b/morituri/program/cdparanoia.py index 3c4533b..5961eb0 100644 --- a/morituri/program/cdparanoia.py +++ b/morituri/program/cdparanoia.py @@ -405,6 +405,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask): if not self.exception: self.quality = max(self.tasks[0].quality, self.tasks[2].quality) self.peak = self.tasks[4].peak + self.debug('peak: %r', self.peak) self.testchecksum = c1 = self.tasks[1].checksum self.copychecksum = c2 = self.tasks[3].checksum @@ -424,5 +425,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask): shutil.move(self._tmppath, self.path) except Exception, e: self._exception = e + else: + self.debug('stop: exception %r', self.exception) task.MultiSeparateTask.stop(self)