* morituri/program/cdparanoia.py:

* morituri/rip/cd.py:
	  Add a number of tries to rip a track.
This commit is contained in:
Thomas Vander Stichele
2012-11-11 22:40:53 +00:00
parent e4cbc33583
commit 4a4e1ba128
3 changed files with 29 additions and 13 deletions

View File

@@ -1,3 +1,9 @@
2012-11-11 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/program/cdparanoia.py:
* morituri/rip/cd.py:
Add a number of tries to rip a track.
2012-11-10 Thomas Vander Stichele <thomas at apestaart dot org>
* misc/pep8.py (added):

View File

@@ -53,6 +53,11 @@ class ReturnCodeError(Exception):
self.args = (returncode, )
self.returncode = returncode
class ChecksumException(Exception):
pass
_PROGRESS_RE = re.compile(r"""
^\#\#: (?P<code>.+)\s # function code
\[(?P<function>.*)\]\s@\s # function name
@@ -468,27 +473,32 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
# FIXME: detect this before encoding
self.info('Checksums do not match, %08x %08x' % (
c1, c2))
self.error('read and verify failed: test checksum')
self.exception = ChecksumException(
'read and verify failed: test checksum')
if self.tasks[5].checksum != self.checksum:
self.error('Encoding failed, checksum does not match')
self.exception = ChecksumException(
'Encoding failed, checksum does not match')
# delete the unencoded file
os.unlink(self._tmpwavpath)
os.chmod(self._tmppath, self.file_mode)
try:
self.debug('Moving to final path %r', self.path)
shutil.move(self._tmppath, self.path)
except IOError, e:
if e.errno == errno.ENAMETOOLONG:
self.path = common.shrinkPath(self.path)
if not self.exception:
try:
self.debug('Moving to final path %r', self.path)
shutil.move(self._tmppath, self.path)
except Exception, e:
self.debug('Exception while moving to final path %r: %r',
self.path, log.getExceptionMessage(e))
self.exception = e
except IOError, e:
if e.errno == errno.ENAMETOOLONG:
self.path = common.shrinkPath(self.path)
shutil.move(self._tmppath, self.path)
except Exception, e:
self.debug('Exception while moving to final path %r: %r',
self.path, log.getExceptionMessage(e))
self.exception = e
else:
os.unlink(self._tmppath)
else:
self.debug('stop: exception %r', self.exception)
except Exception, e:

View File

@@ -246,7 +246,7 @@ See http://sourceforge.net/tracker/?func=detail&aid=604751&group_id=2171&atid=1
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' % (