* morituri/program/cdparanoia.py:

Add a task to read and verify a track.
	* examples/readtrack.py:
	  Use it to clean up code.
	* morituri/common/task.py:
	  describe a MultiTask better.
This commit is contained in:
Thomas Vander Stichele
2009-05-03 17:44:23 +00:00
parent 4e62448000
commit d1c3bb3def
4 changed files with 72 additions and 21 deletions

View File

@@ -19,31 +19,21 @@ def main():
runner = task.SyncRunner()
checksums = []
for i in range(2):
fd, path = tempfile.mkstemp(suffix='.morituri')
os.close(fd)
fd, path = tempfile.mkstemp(suffix='.morituri')
os.close(fd)
fakeTable = table.Table([
table.Track( 1, 0, 15536),
])
fakeTable = table.Table([
table.Track( 1, 0, 15536),
])
t = cdparanoia.ReadTrackTask(path, fakeTable, 1000, 3000, offset=0)
t = cdparanoia.ReadVerifyTrackTask(path, fakeTable, 1000, 3000, offset=0)
if i == 1:
t.description = 'Verifying track...'
runner.run(t)
t = checksum.CRC32Task(path)
runner.run(t)
if i == 0:
os.unlink(path)
checksums.append(t.checksum)
runner.run(t)
print 'runner done'
if checksums[0] == checksums[1]:
if t.checksum is not None:
print 'Checksums match'
else:
print 'Checksums do not match'