Commit 95f949d1 authored by Radek Hušek's avatar Radek Hušek
Browse files

do not crash if lpstat fails

parent 68cf94cc
......@@ -78,11 +78,14 @@ class CPP(QWidget):
self._printers = self._config.get("printers", [])
self._printers.append(("Save as ...", self._save_as_file))
try:
for l in sp.check_output(["lpstat", "-a"]).decode("UTF-8").split("\n"):
p = l.split(" ")[0]
if p == "":
continue
self._printers.append((p, ["lp", "-d", p]))
except:
pass
def init_gui(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment