pep8 fixes

This commit is contained in:
Thomas Vander Stichele
2012-11-11 22:39:13 +00:00
parent c2f827c24c
commit e4cbc33583
7 changed files with 46 additions and 29 deletions

View File

@@ -37,6 +37,9 @@ from morituri.extern.task import task
DEFAULT_TRACK_TEMPLATE = u'%A - %d/%t. %a - %n'
DEFAULT_DISC_TEMPLATE = u'%A - %d/%A - %d'
MAX_TRIES = 5
class Rip(logcommand.LogCommand):
summary = "rip CD"
@@ -224,16 +227,30 @@ See http://sourceforge.net/tracker/?func=detail&aid=604751&group_id=2171&atid=1
os.unlink(path)
if not os.path.exists(path):
tries = 0
print 'Ripping track %d of %d: %s' % (
number, len(itable.tracks),
os.path.basename(path).encode('utf-8'))
prog.ripTrack(runner, trackResult,
offset=int(self.options.offset),
device=self.parentCommand.options.device,
profile=profile,
taglist=prog.getTagList(number),
what='track %d of %d' % (number, len(itable.tracks)))
while tries < MAX_TRIES:
tries += 1
try:
self.debug('ripIfNotRipped: track %d, try %d',
number, tries)
prog.ripTrack(runner, trackResult,
offset=int(self.options.offset),
device=self.parentCommand.options.device,
profile=profile,
taglist=prog.getTagList(number),
what='track %d of %d' % (number, len(itable.tracks)))
break
except Exception, e:
self.debug('Got exception %r on try %d',
e, tries)
if tries == MAX_TRIES:
self.error('Giving up on track %d after %d times' % (
number, tries))
if trackResult.testcrc == trackResult.copycrc:
print 'Checksums match for track %d' % (number)
else: