Skip to content

Commit

Permalink
Switch to libcdio-cdparanoia (from cdparanoia) (#213)
Browse files Browse the repository at this point in the history
* Switch to libcdio-cdparanoia (from cdparanoia)

Next commits will add a choice to fall back to the old one, or pick a
different name. But let's get this ready for testing now.

* Add libcdio-utils to .travis.yml

* Parse libcdio-paranoia version instead of cdparanoia

* Remove useless digit checking test
  • Loading branch information
MerlijnWajer authored and JoeLametta committed Jan 26, 2018
1 parent cac64f0 commit 5dbb197
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install:
# Dependencies
- sudo apt-get -qq update
- sudo pip install --upgrade -qq pip
- sudo apt-get -qq install cdparanoia cdrdao flac libcdio-dev libiso9660-dev libsndfile1-dev python-cddb python-gobject python-musicbrainzngs python-mutagen python-setuptools sox swig
- sudo apt-get -qq install cdparanoia cdrdao flac libcdio-dev libiso9660-dev libsndfile1-dev python-cddb python-gobject python-musicbrainzngs python-mutagen python-setuptools sox swig libcdio-utils
- sudo pip install pycdio requests

# Testing dependencies
Expand Down
16 changes: 8 additions & 8 deletions whipper/program/cdparanoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ def start(self, runner):

bufsize = 1024
if self._overread:
argv = ["cdparanoia", "--stderr-progress",
argv = ["cd-paranoia", "--stderr-progress",
"--sample-offset=%d" % self._offset, "--force-overread", ]
else:
argv = ["cdparanoia", "--stderr-progress",
argv = ["cd-paranoia", "--stderr-progress",
"--sample-offset=%d" % self._offset, ]
if self._device:
argv.extend(["--force-cdrom-device", self._device, ])
Expand All @@ -317,7 +317,7 @@ def start(self, runner):
except OSError as e:
import errno
if e.errno == errno.ENOENT:
raise common.MissingDependencyException('cdparanoia')
raise common.MissingDependencyException('cd-paranoia')

raise

Expand Down Expand Up @@ -575,12 +575,12 @@ def stop(self):


_VERSION_RE = re.compile(
"^cdparanoia (?P<version>.+) release (?P<release>.+) \(.*\)")
"^cdparanoia (?P<version>.+) release (?P<release>.+)")


def getCdParanoiaVersion():
getter = common.VersionGetter('cdparanoia',
["cdparanoia", "-V"],
getter = common.VersionGetter('cd-paranoia',
["cd-paranoia", "-V"],
_VERSION_RE,
"%(version)s %(release)s")

Expand All @@ -605,12 +605,12 @@ class AnalyzeTask(ctask.PopenTask):
def __init__(self, device=None):
# cdparanoia -A *always* writes cdparanoia.log
self.cwd = tempfile.mkdtemp(suffix='.whipper.cache')
self.command = ['cdparanoia', '-A']
self.command = ['cd-paranoia', '-A']
if device:
self.command += ['-d', device]

def commandMissing(self):
raise common.MissingDependencyException('cdparanoia')
raise common.MissingDependencyException('cd-paranoia')

def readbyteserr(self, bytes):
self._output.append(bytes)
Expand Down
3 changes: 0 additions & 3 deletions whipper/test/test_program_cdparanoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ class VersionTestCase(common.TestCase):
def testGetVersion(self):
v = cdparanoia.getCdParanoiaVersion()
self.failUnless(v)
# of the form III 10.2
# make sure it ends with a digit
self.failUnless(int(v[-1]), v)


class AnalyzeFileTask(cdparanoia.AnalyzeTask):
Expand Down

0 comments on commit 5dbb197

Please sign in to comment.