* morituri/program/cdrdao.py:

Parse version number.
	* morituri/rip/cd.py:
	  Warn about cdrdao versions with a bug.
	* morituri/test/test_program_cdrdao.py:
	  Test that we can parse the version.
This commit is contained in:
Thomas Vander Stichele
2009-09-05 22:06:02 +00:00
parent e61a10266d
commit 6df7313dc4
4 changed files with 23 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ class ProgramError(Exception):
states = ['START', 'TRACK', 'LEADOUT', 'DONE']
_VERSION_RE = re.compile(r'^Cdrdao version (?P<version>.*) - \(C\)')
_ANALYZING_RE = re.compile(r'^Analyzing track (?P<track>\d+).*')
_TRACK_RE = re.compile(r"""
@@ -114,7 +116,9 @@ class OutputParser(object, log.Loggable):
self._tracks = 0 # count of tracks, relative to session
self._session = session
self.table = table.Table() # the index table for the TOC
self.version = None # cdrdao version
def read(self, bytes):
self.log('received %d bytes in state %s', len(bytes), self._state)
@@ -178,6 +182,10 @@ class OutputParser(object, log.Loggable):
getattr(self, methodName)(line)
def _parse_START(self, line):
if line.startswith('Cdrdao version'):
m = _VERSION_RE.search(line)
self.version = m.group('version')
if line.startswith('Track'):
self.debug('Found possible track line')
if line == "Track Mode Flags Start Length":