From 1865641a39c7ac40f8040361a79c7894470b2f33 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 11 Jan 2010 16:09:39 +0000 Subject: [PATCH] - Fixed traceback when copying printer with certain job options set (bug #554268). --- system-config-printer-copy-crash.patch | 50 ++++++++++++++++++++++++++ system-config-printer.spec | 8 ++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 system-config-printer-copy-crash.patch diff --git a/system-config-printer-copy-crash.patch b/system-config-printer-copy-crash.patch new file mode 100644 index 0000000..c85d29f --- /dev/null +++ b/system-config-printer-copy-crash.patch @@ -0,0 +1,50 @@ +diff -up system-config-printer-1.1.16/options.py.copy-crash system-config-printer-1.1.16/options.py +--- system-config-printer-1.1.16/options.py.copy-crash 2009-12-22 14:44:19.000000000 +0000 ++++ system-config-printer-1.1.16/options.py 2010-01-11 16:05:04.352909594 +0000 +@@ -1,8 +1,9 @@ + ## system-config-printer + +-## Copyright (C) 2006, 2007, 2008 Red Hat, Inc. +-## Copyright (C) 2008 Tim Waugh +-## Copyright (C) 2006 Florian Festi ++## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc. ++## Authors: ++## Tim Waugh ++## Florian Festi + + ## This program is free software; you can redistribute it and/or modify + ## it under the terms of the GNU General Public License as published by +@@ -63,6 +64,9 @@ def OptionWidget(name, v, s, on_change): + # --------------------------------------------------------------------------- + + class OptionInterface: ++ def get_default(self): ++ return None ++ + def get_current_value(self): + raise NotImplemented + +@@ -105,6 +109,9 @@ class OptionAlwaysShown(OptionInterface) + self.use_supported = use_supported + self.reinit (None) + ++ def get_default(self): ++ return self.system_default ++ + def set_default(self, system_default): + # For the media option, the system default depends on the printer's + # PageSize setting. This method allows the main module to tell us +diff -up system-config-printer-1.1.16/system-config-printer.py.copy-crash system-config-printer-1.1.16/system-config-printer.py +--- system-config-printer-1.1.16/system-config-printer.py.copy-crash 2010-01-11 16:05:04.342910797 +0000 ++++ system-config-printer-1.1.16/system-config-printer.py 2010-01-11 16:05:22.957910696 +0000 +@@ -2069,8 +2069,8 @@ class GUI(GtkGUI, monitor.Watcher): + printer.unsetOption(option) + for option in self.server_side_options.itervalues(): + if (option.is_changed() or +- saveall and +- option.get_current_value () != option.system_default): ++ (saveall and ++ option.get_current_value () != option.get_default())): + printer.setOption(option.name, option.get_current_value()) + + except cups.IPPError, (e, s): diff --git a/system-config-printer.spec b/system-config-printer.spec index 4f9d834..c0e872b 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -7,7 +7,7 @@ Summary: A printer administration tool Name: system-config-printer Version: 1.1.16 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ URL: http://cyberelk.net/tim/software/system-config-printer/ Group: System Environment/Base @@ -25,6 +25,7 @@ Patch7: system-config-printer-notification-timeouts.patch Patch8: system-config-printer-select-nonexistent-printer.patch Patch9: system-config-printer-ink-levels.patch Patch10: system-config-printer-auth-no-pw.patch +Patch11: system-config-printer-copy-crash.patch Patch101: pycups-request-readio.patch @@ -96,6 +97,7 @@ printers. %patch8 -p1 -b .select-nonexistent-printer %patch9 -p1 -b .ink-levels %patch10 -p1 -b .auth-no-pw +%patch11 -p1 -b .copy-crash pushd pycups-%{pycups_version} %patch101 -p1 -b .request-readio @@ -216,6 +218,10 @@ rm -rf %buildroot exit 0 %changelog +* Mon Jan 11 2010 Tim Waugh - 1.1.16-8 +- Fixed traceback when copying printer with certain job options + set (bug #554268). + * Mon Jan 11 2010 Tim Waugh - 1.1.16-7 - Fixed traceback introduced in recent fix (bug #554376).