Add error handling for parse-edid call.

If parse-edid can not parse the given edid, use "Unknown" for vendor
and model name.
This commit is contained in:
Alexander Grothe 2018-05-08 10:28:25 +02:00
parent 6724ddcc23
commit 70945dc97b
4 changed files with 490 additions and 474 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5035,7 +5035,12 @@ def parse_xrandr_verbose(iterator):
def parse_edid_data(edid):
vendor = "Unknown"
model = "Unknown"
data = subprocess.check_output("parse-edid < {}".format(edid), shell=True, universal_newlines=True)
try:
data = subprocess.check_output("parse-edid < {}".format(edid),
shell=True, universal_newlines=True)
except subprocess.CalledProcessError:
pass
else:
for line in data.splitlines():
if "VendorName" in line:
vendor = line.strip().split('"')[1]

View File

@ -174,7 +174,12 @@ def parse_xrandr_verbose(iterator):
def parse_edid_data(edid):
vendor = "Unknown"
model = "Unknown"
data = subprocess.check_output("parse-edid < {}".format(edid), shell=True, universal_newlines=True)
try:
data = subprocess.check_output("parse-edid < {}".format(edid),
shell=True, universal_newlines=True)
except subprocess.CalledProcessError:
pass
else:
for line in data.splitlines():
if "VendorName" in line:
vendor = line.strip().split('"')[1]

View File

@ -0,0 +1 @@
lircd0_socket: /var/run/lirc/lircd0