From 4fdfb7f58cbd2926b0ff6d975cfdbc9b0192caec Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 18 Sep 2011 09:18:47 +0000 Subject: [PATCH] * morituri/program/cdparanoia.py: Log properly again. Properly set exception when we can't rename the file. --- ChangeLog | 6 ++++++ morituri/program/cdparanoia.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e28eb45..b2dc742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-18 Thomas Vander Stichele + + * morituri/program/cdparanoia.py: + Log properly again. + Properly set exception when we can't rename the file. + 2011-09-15 Thomas Vander Stichele * morituri/extern/task/gstreamer.py: diff --git a/morituri/program/cdparanoia.py b/morituri/program/cdparanoia.py index c6f638a..56579b0 100644 --- a/morituri/program/cdparanoia.py +++ b/morituri/program/cdparanoia.py @@ -182,7 +182,7 @@ class ProgressParser(object): # FIXME: handle errors -class ReadTrackTask(task.Task): +class ReadTrackTask(log.Loggable, task.Task): """ I am a task that reads a track using cdparanoia. @@ -360,10 +360,13 @@ class ReadTrackTask(task.Task): self.stop() return -class ReadVerifyTrackTask(task.MultiSeparateTask): +class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask): """ I am a task that reads and verifies a track using cdparanoia. + The path where the file is stored can be changed if necessary, for + example if the file name is too long. + @ivar path: the path where the file is to be stored. @ivar checksum: the checksum of the track; set if they match. @ivar testchecksum: the test checksum of the track. @@ -473,9 +476,12 @@ class ReadVerifyTrackTask(task.MultiSeparateTask): os.chmod(self._tmppath, self.file_mode) try: + self.debug('Moving to final path %r', self.path) shutil.move(self._tmppath, self.path) except Exception, e: - self._exception = e + self.debug('Exception while moving to final path %r: %r', + self.path, log.getExceptionMessage(e)) + self.exception = e else: self.debug('stop: exception %r', self.exception) except Exception, e: