Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show-jobs improvements to show all queues #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions system-config-printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def show_help():
"a CUPS server configuration program.\n\n"
"Options:\n\n"
" --debug Enable debugging output.\n"
" --show-jobs <printer> Show the print queue for <printer>\n"
" --show-jobs <printer> Show the print queue for <printer> or 'ALL' for all printers\n"
" --my-jobs Show only the actual users jobs, if you have used the --show-jobs option\n"
" --help Show this message.\n")

if len(sys.argv)>1 and sys.argv[1] == '--help':
Expand Down Expand Up @@ -2178,8 +2179,12 @@ def main(show_jobs):
DBusGMainLoop (set_as_default=True)

if show_jobs:
viewer = jobviewer.JobViewer (None, None, my_jobs=False,
specific_dests=[show_jobs])
if show_jobs == "ALL":
viewer = jobviewer.JobViewer (None, None, my_jobs=my_jobs,
specific_dests=None)
else:
viewer = jobviewer.JobViewer (None, None, my_jobs=my_jobs,
specific_dests=[show_jobs])
viewer.connect ('finished', Gtk.main_quit)
else:
mainwindow = GUI()
Expand All @@ -2194,18 +2199,21 @@ def main(show_jobs):
import getopt
try:
opts, args = getopt.gnu_getopt (sys.argv[1:], '',
['debug', 'show-jobs='])
['debug', 'show-jobs=', 'my-jobs'])
except getopt.GetoptError:
show_help ()
sys.exit (1)

show_jobs = False
my_jobs = False

for opt, optarg in opts:
if opt == '--debug':
set_debugging (True)
cupshelpers.set_debugprint_fn (debugprint)
elif opt == '--show-jobs':
show_jobs = optarg
elif opt == '--my-jobs':
my_jobs = True

main(show_jobs)
main(show_jobs, my_jobs)