35
35
import logging
36
36
logger = logging .getLogger (__name__ )
37
37
38
+ cdparanoia = 'cd-paranoia'
38
39
39
40
class FileSizeError (Exception ):
40
41
"""The given path does not have the expected size."""
@@ -69,6 +70,12 @@ class ChecksumException(Exception):
69
70
70
71
_ERROR_RE = re .compile ("^scsi_read error:" )
71
72
73
+
74
+ def setCdParanoiaCommand (cmd ):
75
+ global cdparanoia
76
+ cdparanoia = cmd
77
+
78
+
72
79
# from reading cdparanoia source code, it looks like offset is reported in
73
80
# number of single-channel samples, ie. 2 bytes (word) per unit, and absolute
74
81
@@ -271,10 +278,10 @@ def start(self, runner):
271
278
272
279
bufsize = 1024
273
280
if self ._overread :
274
- argv = ["cd-paranoia" , "--stderr-progress" ,
281
+ argv = [cdparanoia , "--stderr-progress" ,
275
282
"--sample-offset=%d" % self ._offset , "--force-overread" , ]
276
283
else :
277
- argv = ["cd-paranoia" , "--stderr-progress" ,
284
+ argv = [cdparanoia , "--stderr-progress" ,
278
285
"--sample-offset=%d" % self ._offset , ]
279
286
if self ._device :
280
287
argv .extend (["--force-cdrom-device" , self ._device , ])
@@ -573,7 +580,7 @@ def stop(self):
573
580
574
581
def getCdParanoiaVersion ():
575
582
getter = common .VersionGetter ('cd-paranoia' ,
576
- ["cd-paranoia" , "-V" ],
583
+ [cdparanoia , "-V" ],
577
584
_VERSION_RE ,
578
585
"%(version)s %(release)s" )
579
586
@@ -599,7 +606,7 @@ class AnalyzeTask(ctask.PopenTask):
599
606
def __init__ (self , device = None ):
600
607
# cdparanoia -A *always* writes cdparanoia.log
601
608
self .cwd = tempfile .mkdtemp (suffix = '.whipper.cache' )
602
- self .command = ['cd-paranoia' , '-A' ]
609
+ self .command = [cdparanoia , '-A' ]
603
610
if device :
604
611
self .command += ['-d' , device ]
605
612
0 commit comments