Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Radek Hušek
cups-pdf-postprocess
Commits
95f949d1
Commit
95f949d1
authored
Jan 26, 2022
by
Radek Hušek
Browse files
do not crash if lpstat fails
parent
68cf94cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
cups-pdf-postprocess.py
View file @
95f949d1
...
...
@@ -78,11 +78,14 @@ class CPP(QWidget):
self
.
_printers
=
self
.
_config
.
get
(
"printers"
,
[])
self
.
_printers
.
append
((
"Save as ..."
,
self
.
_save_as_file
))
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
]))
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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment