handle soapy not being installed at all, references #42

This commit is contained in:
Jakob Ketterl 2019-12-30 16:38:16 +01:00
parent 9c82a80273
commit 092a2e5ca0
1 changed files with 10 additions and 7 deletions

View File

@ -221,15 +221,18 @@ class FeatureDetector(object):
return self._check_connector("soapy_connector")
def _has_soapy_driver(self, driver):
process = subprocess.Popen(["SoapySDRUtil", "--info"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
driverRegex = re.compile("^Module found: .*lib(.*)Support.so")
try:
process = subprocess.Popen(["SoapySDRUtil", "--info"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
driverRegex = re.compile("^Module found: .*lib(.*)Support.so")
def matchLine(line):
matches = driverRegex.match(line.decode())
return matches is not None and matches.group(1) == driver
def matchLine(line):
matches = driverRegex.match(line.decode())
return matches is not None and matches.group(1) == driver
lines = [matchLine(line) for line in process.stdout]
return reduce(or_, lines, False)
lines = [matchLine(line) for line in process.stdout]
return reduce(or_, lines, False)
except FileNotFoundError:
return False
def has_soapy_sdrplay(self):
"""