* morituri/program/cdparanoia.py:
Log properly again. Properly set exception when we can't rename the file.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2011-09-18 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* morituri/program/cdparanoia.py:
|
||||||
|
Log properly again.
|
||||||
|
Properly set exception when we can't rename the file.
|
||||||
|
|
||||||
2011-09-15 Thomas Vander Stichele <thomas at apestaart dot org>
|
2011-09-15 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* morituri/extern/task/gstreamer.py:
|
* morituri/extern/task/gstreamer.py:
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class ProgressParser(object):
|
|||||||
|
|
||||||
|
|
||||||
# FIXME: handle errors
|
# FIXME: handle errors
|
||||||
class ReadTrackTask(task.Task):
|
class ReadTrackTask(log.Loggable, task.Task):
|
||||||
"""
|
"""
|
||||||
I am a task that reads a track using cdparanoia.
|
I am a task that reads a track using cdparanoia.
|
||||||
|
|
||||||
@@ -360,10 +360,13 @@ class ReadTrackTask(task.Task):
|
|||||||
self.stop()
|
self.stop()
|
||||||
return
|
return
|
||||||
|
|
||||||
class ReadVerifyTrackTask(task.MultiSeparateTask):
|
class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
|
||||||
"""
|
"""
|
||||||
I am a task that reads and verifies a track using cdparanoia.
|
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 path: the path where the file is to be stored.
|
||||||
@ivar checksum: the checksum of the track; set if they match.
|
@ivar checksum: the checksum of the track; set if they match.
|
||||||
@ivar testchecksum: the test checksum of the track.
|
@ivar testchecksum: the test checksum of the track.
|
||||||
@@ -473,9 +476,12 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
|||||||
os.chmod(self._tmppath, self.file_mode)
|
os.chmod(self._tmppath, self.file_mode)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
self.debug('Moving to final path %r', self.path)
|
||||||
shutil.move(self._tmppath, self.path)
|
shutil.move(self._tmppath, self.path)
|
||||||
except Exception, e:
|
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:
|
else:
|
||||||
self.debug('stop: exception %r', self.exception)
|
self.debug('stop: exception %r', self.exception)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user