def _is_available(self): if check_executable(self.ioptions['festival']): cmd = ['festival', '--pipe'] with tempfile.SpooledTemporaryFile() as in_f: self._logger.debug('Executing %s', ' '.join([pipes.quote(arg) for arg in cmd])) output = subprocess.check_output(cmd, stdin=in_f, stderr=subprocess.STDOUT, universal_newlines=True).strip() return 'No default voice found' not in output return False # pragma: no cover
def _is_available(self): if check_executable(self.ioptions['festival']): cmd = ['festival', '--pipe'] with tempfile.SpooledTemporaryFile() as in_f: self._logger.debug('Executing %s', ' '.join([pipes.quote(arg) for arg in cmd])) output = subprocess.check_output( cmd, stdin=in_f, stderr=subprocess.STDOUT, universal_newlines=True).strip() return 'No default voice found' not in output return False # pragma: no cover
def sound_available(self): return winsound or check_executable('aplay')
def test_check_executable_not_found(self): self.assertFalse( check_executable('aieaoauu_not-findable_lfsdauybqwer'))
def test_check_executable_found(self): self.assertTrue(check_executable('file'))
def test_check_executable_not_found(self): self.assertFalse(check_executable('aieaoauu_not-findable_lfsdauybqwer'))
def _is_available(self): return check_executable(self.ioptions['flite'])
def _is_available(self): return check_executable(self.ioptions['pico2wave'])