patch by: mustbenice
* morituri/common/program.py: * morituri/program/cdparanoia.py: * morituri/result/logger.py: * morituri/result/result.py: Calculate speed of reading track. Output Test and Copy speed per track in log.
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2012-11-25 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
patch by: mustbenice
|
||||
|
||||
* morituri/common/program.py:
|
||||
* morituri/program/cdparanoia.py:
|
||||
* morituri/result/logger.py:
|
||||
* morituri/result/result.py:
|
||||
Calculate speed of reading track.
|
||||
Output Test and Copy speed per track in log.
|
||||
|
||||
2012-11-25 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri.spec.in:
|
||||
|
||||
@@ -474,6 +474,8 @@ class Program(log.Loggable):
|
||||
trackResult.copycrc = t.copychecksum
|
||||
trackResult.peak = t.peak
|
||||
trackResult.quality = t.quality
|
||||
trackResult.testspeed = t.testspeed
|
||||
trackResult.copyspeed = t.copyspeed
|
||||
|
||||
if trackResult.filename != t.path:
|
||||
trackResult.filename = t.path
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import os
|
||||
import errno
|
||||
import time
|
||||
import re
|
||||
import stat
|
||||
import shutil
|
||||
@@ -203,6 +204,7 @@ class ReadTrackTask(log.Loggable, task.Task):
|
||||
|
||||
description = "Reading track"
|
||||
quality = None # set at end of reading
|
||||
speed = None
|
||||
|
||||
_MAXERROR = 100 # number of errors detected by parser
|
||||
|
||||
@@ -237,6 +239,7 @@ class ReadTrackTask(log.Loggable, task.Task):
|
||||
self._offset = offset
|
||||
self._parser = ProgressParser(start, stop)
|
||||
self._device = device
|
||||
self._start_time = None
|
||||
|
||||
self._buffer = "" # accumulate characters
|
||||
self._errors = []
|
||||
@@ -288,6 +291,7 @@ class ReadTrackTask(log.Loggable, task.Task):
|
||||
|
||||
raise
|
||||
|
||||
self._start_time = time.time()
|
||||
self.schedule(1.0, self._read, runner)
|
||||
|
||||
def _read(self, runner):
|
||||
@@ -339,6 +343,7 @@ class ReadTrackTask(log.Loggable, task.Task):
|
||||
self._done()
|
||||
|
||||
def _done(self):
|
||||
end_time = time.time()
|
||||
self.setProgress(1.0)
|
||||
|
||||
# check if the length matches
|
||||
@@ -368,6 +373,7 @@ class ReadTrackTask(log.Loggable, task.Task):
|
||||
self.exception = ReturnCodeError(self._popen.returncode)
|
||||
|
||||
self.quality = self._parser.getTrackQuality()
|
||||
self.speed = (offsetLength / 75) / (end_time - self._start_time)
|
||||
|
||||
self.stop()
|
||||
return
|
||||
@@ -392,6 +398,8 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
|
||||
copychecksum = None
|
||||
peak = None
|
||||
quality = None
|
||||
testspeed = None
|
||||
copyspeed = None
|
||||
|
||||
_tmpwavpath = None
|
||||
_tmppath = None
|
||||
@@ -471,6 +479,8 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
|
||||
self.tasks[2].quality)
|
||||
self.peak = self.tasks[4].peak
|
||||
self.debug('peak: %r', self.peak)
|
||||
self.testspeed = self.tasks[0].speed
|
||||
self.copyspeed = self.tasks[2].speed
|
||||
|
||||
self.testchecksum = c1 = self.tasks[1].checksum
|
||||
self.copychecksum = c2 = self.tasks[3].checksum
|
||||
|
||||
@@ -105,6 +105,13 @@ class MorituriLogger(result.Logger):
|
||||
lines.append('')
|
||||
|
||||
lines.append(' Peak level %.1f %%' % (trackResult.peak * 100.0))
|
||||
if trackResult.copyspeed:
|
||||
lines.append(' Extraction Speed (Copy) %.4f X' % (
|
||||
trackResult.copyspeed))
|
||||
if trackResult.testspeed:
|
||||
lines.append(' Extraction Speed (Test) %.4f X' % (
|
||||
trackResult.testspeed))
|
||||
|
||||
if trackResult.copycrc is not None:
|
||||
lines.append(' Copy CRC %08X' % trackResult.copycrc)
|
||||
if trackResult.testcrc is not None:
|
||||
@@ -116,6 +123,7 @@ class MorituriLogger(result.Logger):
|
||||
else:
|
||||
lines.append(" WARNING: no CRC check done")
|
||||
|
||||
|
||||
if trackResult.accurip:
|
||||
lines.append(' Accurately ripped (confidence %d) [%08X]' % (
|
||||
trackResult.ARDBConfidence, trackResult.ARCRC))
|
||||
|
||||
@@ -60,6 +60,8 @@ class TrackResult:
|
||||
|
||||
peak = 0.0
|
||||
quality = 0.0
|
||||
testspeed = 0.0
|
||||
copyspeed = 0.0
|
||||
testcrc = None
|
||||
copycrc = None
|
||||
accurip = False # whether it's in the database
|
||||
|
||||
Reference in New Issue
Block a user