Files
whipper-gui/examples/readtrack.py
Thomas Vander Stichele 54c7322a04 * examples/readtrack.py:
* morituri/program/cdparanoia.py:
	  Move ReadTrackTask to cdparanoia module.
2009-05-01 18:52:51 +00:00

46 lines
867 B
Python

# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
import re
import os
import subprocess
import tempfile
from morituri.common import task, checksum, log
from morituri.program import cdparanoia
import gobject
gobject.threads_init()
def main():
log.init()
runner = task.SyncRunner()
checksums = []
for i in range(2):
fd, path = tempfile.mkstemp(suffix='.morituri')
os.close(fd)
t = cdparanoia.ReadTrackTask(path, 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)
print 'runner done'
if checksums[0] == checksums[1]:
print 'Checksums match'
else:
print 'Checksums do not match'
main()