Prevent traceback during libsane-hpaio installation check.

This commit is contained in:
Tim Waugh 2011-02-17 10:00:53 +00:00
parent aabf0245ed
commit f489c6ff14
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
diff -up system-config-printer-1.3.0/newprinter.py.hp-scannable system-config-printer-1.3.0/newprinter.py
--- system-config-printer-1.3.0/newprinter.py.hp-scannable 2011-02-16 13:02:45.000000000 +0000
+++ system-config-printer-1.3.0/newprinter.py 2011-02-17 09:58:51.867125793 +0000
@@ -971,7 +971,8 @@ class NewPrinterGUI(GtkGUI):
ready (self.NewPrinterWindow)
return
- if (self.device.hp_scannable and
+ if (hasattr (self.device, 'hp_scannable') and
+ self.device.hp_scannable and
not os.access ("/etc/sane.d/dll.d/hpaio", os.R_OK)):
try:
pk = installpackage.PackageKit ()
@@ -2467,15 +2468,6 @@ class NewPrinterGUI(GtkGUI):
physicaldevice.add_device (faxdev)
physicaldevice.set_data ('hp-scannable', True)
- if hp_scannable and not os.access ("/etc/sane.d/dll.d/hpaio",
- os.R_OK):
- try:
- pk = installpackage.PackageKit ()
- xid = self.NewPrinterWindow.window.xid
- pk.InstallPackageName (xid, 0, "libsane-hpaio")
- except:
- pass
-
physicaldevice.set_data ('checked-hplip', True)
device.hp_scannable = physicaldevice.get_data ('hp-scannable')
diff -up system-config-printer-1.3.0/system-config-printer.py.hp-scannable system-config-printer-1.3.0/system-config-printer.py

View File

@ -5,12 +5,13 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.3.0
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
Source0: http://cyberelk.net/tim/data/system-config-printer/1.2/%{name}-%{version}.tar.xz
Patch1: system-config-printer-no-job-notifications.patch
Patch2: system-config-printer-hp-scannable.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
BuildRequires: gettext-devel
@ -68,6 +69,7 @@ printers.
%prep
%setup -q
%patch1 -p1 -b .no-job-notifications
%patch2 -p1 -b .hp-scannable
%build
%configure --with-udev-rules
@ -177,6 +179,9 @@ rm -rf %buildroot
exit 0
%changelog
* Thu Feb 17 2011 Tim Waugh <twaugh@redhat.com> 1.3.0-3
- Prevent traceback during libsane-hpaio installation check.
* Wed Feb 16 2011 Tim Waugh <twaugh@redhat.com> 1.3.0-2
- Don't show job notifications from the applet, just do New Printer
notifications and handle requests to install printer drivers