* morituri/program/cdparanoia.py:

Log properly again.
	  Properly set exception when we can't rename the file.
This commit is contained in:
Thomas Vander Stichele
2011-09-18 09:18:47 +00:00
parent ba3dd85dc5
commit 4fdfb7f58c
2 changed files with 15 additions and 3 deletions

View File

@@ -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: