patch by: mustbenice

* morituri/program/cdparanoia.py:
	* morituri/result/result.py:
	* morituri/rip/cd.py:
	* morituri/test/test_program_cdparanoia.py:
	  Get cdparanoia version.
	  Store both cdparanoia and cdrdao versions on rip result.
This commit is contained in:
Thomas Vander Stichele
2012-11-25 22:00:42 +00:00
parent 76e8d94801
commit 31a6bd942a
5 changed files with 59 additions and 2 deletions

View File

@@ -523,3 +523,27 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
print 'WARNING: unhandled exception %r' % (e, )
task.MultiSeparateTask.stop(self)
_VERSION_RE = re.compile("^cdparanoia (?P<version>.+) release (?P<release>.+) \(.*\)")
def getCdparanoiaVersion():
version = "(Unknown)"
try:
p = asyncsub.Popen(["cdparanoia", "-V"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True)
version = asyncsub.recv_some(p, e=0, stderr=1)
vre = _VERSION_RE.search(version)
if vre and len(vre.groups()) == 2:
version = "%s %s" % (
vre.groupdict().get('version'),
vre.groupdict().get('release'))
except OSError, e:
import errno
if e.errno == errno.ENOENT:
raise common.MissingDependencyException('cdparanoia')
raise
return version