Skip to content
Snippets Groups Projects
Commit 95f949d1 authored by Radek Hušek's avatar Radek Hušek
Browse files

do not crash if lpstat fails

parent 68cf94cc
Branches
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment