示例#1
0
    def start(self, runner):
        task.Task.start(self, runner)

        # find on which track the range starts and stops
        startTrack = 0
        startOffset = 0
        stopTrack = 0
        stopOffset = self._stop

        for i, t in enumerate(self._table.tracks):
            if self._table.getTrackStart(i + 1) <= self._start:
                startTrack = i + 1
                startOffset = self._start - self._table.getTrackStart(i + 1)
            if self._table.getTrackEnd(i + 1) <= self._stop:
                stopTrack = i + 1
                stopOffset = self._stop - self._table.getTrackStart(i + 1)

        logger.debug('Ripping from %d to %d (inclusive)',
                     self._start, self._stop)
        logger.debug('Starting at track %d, offset %d',
                     startTrack, startOffset)
        logger.debug('Stopping at track %d, offset %d',
                     stopTrack, stopOffset)

        bufsize = 1024
        if self._overread:
            argv = ["cd-paranoia", "--stderr-progress",
                    "--sample-offset=%d" % self._offset, "--force-overread", ]
        else:
            argv = ["cd-paranoia", "--stderr-progress",
                    "--sample-offset=%d" % self._offset, ]
        if self._device:
            argv.extend(["--force-cdrom-device", self._device, ])
        argv.extend(["%d[%s]-%d[%s]" % (
            startTrack, common.framesToHMSF(startOffset),
            stopTrack, common.framesToHMSF(stopOffset)),
            self.path])
        logger.debug('Running %s' % (" ".join(argv), ))
        try:
            self._popen = asyncsub.Popen(argv,
                                         bufsize=bufsize,
                                         stdin=subprocess.PIPE,
                                         stdout=subprocess.PIPE,
                                         stderr=subprocess.PIPE,
                                         close_fds=True)
        except OSError as e:
            import errno
            if e.errno == errno.ENOENT:
                raise common.MissingDependencyException('cd-paranoia')

            raise

        self._start_time = time.time()
        self.schedule(1.0, self._read, runner)
示例#2
0
 def commandMissing(self):
     raise common.MissingDependencyException('cdparanoia')
示例#3
0
    def start(self, runner):
        task.Task.start(self, runner)

        # find on which track the range starts and stops
        startTrack = 0
        startOffset = 0
        stopTrack = 0
        stopOffset = self._stop

        for i, _ in enumerate(self._table.tracks):
            if self._table.getTrackStart(i + 1) <= self._start:
                startTrack = i + 1
                startOffset = self._start - self._table.getTrackStart(i + 1)
            if self._table.getTrackEnd(i + 1) <= self._stop:
                stopTrack = i + 1
                stopOffset = self._stop - self._table.getTrackStart(i + 1)

        logger.debug('ripping from %d to %d (inclusive)', self._start,
                     self._stop)
        logger.debug('starting at track %d, offset %d', startTrack,
                     startOffset)
        logger.debug('stopping at track %d, offset %d', stopTrack, stopOffset)

        bufsize = 1024
        if self._overread:
            argv = [
                "cd-paranoia",
                "--stderr-progress",
                "--sample-offset=%d" % self._offset,
                "--force-overread",
            ]
        else:
            argv = [
                "cd-paranoia",
                "--stderr-progress",
                "--sample-offset=%d" % self._offset,
            ]
        if self._device:
            argv.extend([
                "--force-cdrom-device",
                self._device,
            ])
        argv.extend([
            "%d[%s]-%d[%s]" % (startTrack, common.framesToHMSF(startOffset),
                               stopTrack, common.framesToHMSF(stopOffset)),
            self.path
        ])
        logger.debug('running %s', (" ".join(argv), ))
        if self._offset > 587:
            logger.warning(
                "because of a cd-paranoia upstream bug whipper may fail to "
                "work correctly when using offset values > 587 (current "
                "value: %d) and print warnings like this: 'file size 0 did "
                "not match expected size'. For more details please check the "
                "following issues: "
                "https://github.com/whipper-team/whipper/issues/234 and "
                "https://github.com/rocky/libcdio-paranoia/issues/14",
                self._offset)
        if stopTrack == 99:
            logger.warning(
                "because of a cd-paranoia upstream bug whipper may fail to "
                "rip the last track of a CD when it has got 99 of them. "
                "For more details please check the following issue: "
                "https://github.com/whipper-team/whipper/issues/302")
        try:
            self._popen = asyncsub.Popen(argv,
                                         bufsize=bufsize,
                                         stdin=subprocess.PIPE,
                                         stdout=subprocess.PIPE,
                                         stderr=subprocess.PIPE,
                                         close_fds=True)
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise common.MissingDependencyException('cd-paranoia')

            raise

        self._start_time = time.time()
        self.schedule(1.0, self._read, runner)
示例#4
0
文件: soxi.py 项目: spvkgn/whipper
 def commandMissing(self):
     raise common.MissingDependencyException('soxi')