Replace if ... else ... with simpler statement
This commit is contained in:
@@ -598,10 +598,7 @@ class AnalyzeTask(ctask.PopenTask):
|
|||||||
shutil.rmtree(self.cwd)
|
shutil.rmtree(self.cwd)
|
||||||
output = "".join(self._output)
|
output = "".join(self._output)
|
||||||
m = _OK_RE.search(output)
|
m = _OK_RE.search(output)
|
||||||
if m:
|
self.defeatsCache = bool(m)
|
||||||
self.defeatsCache = True
|
|
||||||
else:
|
|
||||||
self.defeatsCache = False
|
|
||||||
|
|
||||||
def failed(self):
|
def failed(self):
|
||||||
# cdparanoia exits with return code 1 if it can't determine
|
# cdparanoia exits with return code 1 if it can't determine
|
||||||
|
|||||||
@@ -168,10 +168,7 @@ def DetectCdr(device):
|
|||||||
cmd = [CDRDAO, 'disk-info', '-v1', '--device', device]
|
cmd = [CDRDAO, 'disk-info', '-v1', '--device', device]
|
||||||
logger.debug("executing %r", cmd)
|
logger.debug("executing %r", cmd)
|
||||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
||||||
if 'CD-R medium : n/a' in p.stdout.read():
|
return 'CD-R medium : n/a' not in p.stdout.read()
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
|
|||||||
Reference in New Issue
Block a user