* examples/gtkchecksum.py:

* morituri/common/checksum.py:
	  Final crc->checksum fixes.
This commit is contained in:
Thomas Vander Stichele
2009-04-15 13:41:15 +00:00
parent 587f1a45dd
commit 26bfe85631
3 changed files with 16 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2009-04-15 Thomas Vander Stichele <thomas at apestaart dot org>
* examples/gtkchecksum.py:
* morituri/common/checksum.py:
Final crc->checksum fixes.
2009-04-15 Thomas Vander Stichele <thomas at apestaart dot org>
* examples/ARcue.py:

View File

@@ -27,7 +27,7 @@ gobject.threads_init()
import gtk
from morituri.common import task, crc
from morituri.common import task, checksum
def main(path, start, end):
progress = task.GtkProgressRunner()
@@ -37,12 +37,12 @@ def main(path, start, end):
window.add(progress)
window.show_all()
crctask = crc.CRC32Task(path, start, end)
progress.run(crctask)
checksumtask = checksum.CRC32Task(path, start, end)
progress.run(checksumtask)
gtk.main()
print "CRC: %08X" % crctask.crc
print "CRC: %08X" % checksumtask.checksum
path = 'test.flac'

View File

@@ -197,6 +197,9 @@ class CRC32Task(ChecksumTask):
"""
I do a simple CRC32 check.
"""
description = 'Calculating CRC...'
def do_checksum_buffer(self, buffer, checksum):
return zlib.crc32(buffer, checksum)
@@ -206,6 +209,9 @@ class AccurateRipChecksumTask(ChecksumTask):
See http://www.accuraterip.com/
"""
description = 'Calculating AccurateRip checksum...'
def __init__(self, path, trackNumber, trackCount, frameStart=0, frameLength=-1):
ChecksumTask.__init__(self, path, frameStart, frameLength)
self._trackNumber = trackNumber