* morituri/program/cdparanoia.py:

Add copy and test CRC's to object.
This commit is contained in:
Thomas Vander Stichele
2009-05-23 19:47:58 +00:00
parent 361a83dc27
commit 85e9058594
2 changed files with 19 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
2009-05-23 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/program/cdparanoia.py:
Add copy and test CRC's to object.
2009-05-23 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/Makefile.am:

View File

@@ -224,8 +224,10 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
"""
I am a task that reads and verifies a track using cdparanoia.
@ivar path: the path where the file is to be stored.
@ivar checksum: the checksum of the track.
@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.
@ivar copychecksum: the copy checksum of the track.
"""
def __init__(self, path, table, start, stop, offset=0, device=None):
@@ -264,17 +266,18 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
def stop(self):
if not self.exception:
c1 = self.tasks[1].checksum
c2 = self.tasks[3].checksum
self.testchecksum = c1 = self.tasks[1].checksum
self.copychecksum = c2 = self.tasks[3].checksum
if c1 == c2:
self.info('Checksums match, %08x' % c1)
try:
shutil.move(self._tmppath, self.path)
self.checksum = checksum
except Exception, e:
self._exception = e
self.checksum = self.testchecksum
else:
print 'ERROR: read and verify failed'
self.checksum = None
self.error('read and verify failed')
try:
shutil.move(self._tmppath, self.path)
self.checksum = checksum
except Exception, e:
self._exception = e
task.MultiSeparateTask.stop(self)