[kde-printer-applet] import

Rex Dieter rdieter at fedoraproject.org
Sun Jan 15 01:38:44 UTC 2012


commit eac9412aacac89492a9d0290f797863391429617
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Sat Jan 14 19:38:27 2012 -0600

    import

 .gitignore                                         |    1 +
 kde-printer-applet.spec                            |   84 ++++++++++++++++
 ....4.1-printer-applet-InstallPrinterDrivers.patch |  102 ++++++++++++++++++++
 kdeutils-4.7.1-job-originating-user-name.patch     |   12 +++
 sources                                            |    1 +
 5 files changed, 200 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..c9a004b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/printer-applet-4.7.97.tar.bz2
diff --git a/kde-printer-applet.spec b/kde-printer-applet.spec
new file mode 100644
index 0000000..96272c9
--- /dev/null
+++ b/kde-printer-applet.spec
@@ -0,0 +1,84 @@
+
+Name: kde-printer-applet 
+Summary: KDE printer applet 
+Version: 4.7.97
+Release: 1%{?dist}
+
+License: GPLv2+
+#URL:     https://projects.kde.org/projects/kde/kdeutils/printer-applet
+URL:     http://utils.kde.org/projects/printer-applet
+Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/printer-applet-%{version}.tar.bz2
+
+## upstreamable patches
+# https://bugzilla.redhat.com/show_bug.cgi?id=739642
+Patch51: kdeutils-4.7.1-job-originating-user-name.patch
+
+## upstream patches
+## trunk, added to trunk/4.7, add support for automatic printer driver installation (Tim Waugh, #576660)
+Patch200: kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch
+
+
+BuildRequires: desktop-file-utils
+BuildRequires: kdelibs4-devel >= %{version}
+
+# when split occured
+Conflicts: kdeutils-common < 6:4.7.80
+
+Obsoletes: kdeutils-printer-applet < 6:4.7.80
+Provides:  kdeutils-printer-applet = 6:%{version}-%{release}
+
+Requires: pykde4%{?_kde4_version: >= %{_kde4_version}}
+Requires: dbus-python
+Requires: system-config-printer-libs
+Requires: system-config-printer-udev
+
+
+%description
+Printer Applet is a system tray utility that shows current print jobs,
+shows printer warnings and errors.
+
+%prep
+%setup -q -n printer-applet-%{version} 
+
+%patch51 -p2 -b .job-originating-user-name
+%patch200 -p2 -b .InstallPrinterDrivers
+
+
+%build
+mkdir -p %{_target_platform}
+pushd %{_target_platform}
+%{cmake_kde4} \
+  -DINSTALL_PRINTER_APPLET:BOOL=ON \
+  ..
+popd
+
+make %{?_smp_mflags} -C %{_target_platform}
+
+
+%install
+make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
+
+%find_lang printer-applet --with-kde --without-mo
+
+
+%files -f printer-applet.lang
+%doc COPYING README
+%{_kde4_bindir}/printer-applet
+%{_kde4_datadir}/autostart/printer-applet.desktop
+%{_kde4_appsdir}/printer-applet/
+
+
+%changelog
+* Wed Jan 04 2012 Rex Dieter <rdieter at fedoraproject.org> 4.7.97-1
+- 4.7.97
+
+* Sat Dec 24 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.95-1
+- 4.7.95
+
+* Thu Dec 08 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.90-1
+- 4.7.90
+- rename to kde-printer-applet 
+
+* Sat Nov 26 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.80-1
+- first try
+
diff --git a/kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch b/kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch
new file mode 100644
index 0000000..c3f19df
--- /dev/null
+++ b/kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch
@@ -0,0 +1,102 @@
+diff -up kdeutils-4.4.1/printer-applet/CMakeLists.txt.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/CMakeLists.txt
+--- kdeutils-4.4.1/printer-applet/CMakeLists.txt.InstallPrinterDrivers	2009-08-12 10:59:22.000000000 +0100
++++ kdeutils-4.4.1/printer-applet/CMakeLists.txt	2010-03-24 17:35:19.174516425 +0000
+@@ -34,6 +34,7 @@ IF(INSTALL_PRINTER_APPLET)
+         monitor.py
+         authconn.py
+         debug.py
++        installdriver.py
+         DESTINATION ${DATA_INSTALL_DIR}/printer-applet )
+     PYKDE4_ADD_EXECUTABLE(printer-applet.py printer-applet)
+     install(FILES printer-applet.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
+diff -up kdeutils-4.4.1/printer-applet/installdriver.py.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/installdriver.py
+--- kdeutils-4.4.1/printer-applet/installdriver.py.InstallPrinterDrivers	2010-03-24 17:35:19.175516691 +0000
++++ kdeutils-4.4.1/printer-applet/installdriver.py	2010-03-24 17:35:19.176515999 +0000
+@@ -0,0 +1,60 @@
++#!/usr/bin/env python
++
++## system-config-printer
++
++## Copyright (C) 2010 Red Hat, Inc.
++## Author: Tim Waugh <twaugh at redhat.com>
++
++## 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
++## the Free Software Foundation; either version 2 of the License, or
++## (at your option) any later version.
++
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++## GNU General Public License for more details.
++
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software
++## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++import dbus
++import dbus.glib
++import dbus.service
++
++class PrinterDriversInstaller(dbus.service.Object):
++    DBUS_PATH  = "/com/redhat/PrinterDriversInstaller"
++    DBUS_IFACE = "com.redhat.PrinterDriversInstaller"
++    DBUS_OBJ   = "com.redhat.PrinterDriversInstaller"
++
++    def __init__ (self, bus):
++        self.bus = bus
++        bus_name = dbus.service.BusName (self.DBUS_OBJ, bus=bus)
++        dbus.service.Object.__init__ (self, bus_name, self.DBUS_PATH)
++
++    @dbus.service.method(DBUS_IFACE,
++                         in_signature="sss",
++                         async_callbacks=("reply_handler",
++                                          "error_handler"))
++    def InstallDrivers (self, mfg, mdl, cmd,
++                       reply_handler, error_handler):
++        bus = dbus.SessionBus ()
++        obj = bus.get_object ("org.freedesktop.PackageKit",
++                              "/org/freedesktop/PackageKit")
++        proxy = dbus.Interface (obj, "org.freedesktop.PackageKit.Modify")
++        proxy.InstallPrinterDrivers (0, ["MFG:%s;MDL:%s;" % (mfg, mdl)],
++                                     "hide-finished",
++                                     reply_handler=reply_handler,
++                                     error_handler=error_handler,
++                                     timeout=3600)
++
++if __name__ == "__main__":
++    bus = dbus.SystemBus ()
++    import sys
++    if len (sys.argv) < 2 or sys.argv[1] == "--client":
++        # Client
++        obj = bus.get_object (PrinterDriversInstaller.DBUS_OBJ,
++                              PrinterDriversInstaller.DBUS_PATH)
++        proxy = dbus.Interface (obj, PrinterDriversInstaller.DBUS_IFACE)
++        print proxy.InstallDrivers ("MFG", "MDL", "CMD")
+diff -up kdeutils-4.4.1/printer-applet/printer-applet.py.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/printer-applet.py
+--- kdeutils-4.4.1/printer-applet/printer-applet.py.InstallPrinterDrivers	2010-01-31 19:34:24.000000000 +0000
++++ kdeutils-4.4.1/printer-applet/printer-applet.py	2010-03-24 17:36:22.429515862 +0000
+@@ -66,6 +66,7 @@ import dbus.service
+ from statereason import StateReason
+ import monitor
+ import authconn
++import installdriver
+ from debug import *
+ 
+ class PrinterURIIndex:
+@@ -298,6 +299,15 @@ class JobManager(QObject, monitor.Watche
+         except ImportError:
+             pass  # cupshelpers not installed, no new printer notification will be shown
+ 
++        try:
++            installdriver.PrinterDriversInstaller(bus)
++        except Exception, e:
++            try:
++                print >> sys.stderr, ("failed to start PrinterDriversInstaller "
++                                      "service: %s" % e)
++            except:
++                pass
++
+     def cleanup (self):
+         self.monitor.cleanup ()
+         if self.exit_handler:
diff --git a/kdeutils-4.7.1-job-originating-user-name.patch b/kdeutils-4.7.1-job-originating-user-name.patch
new file mode 100644
index 0000000..4a5fed2
--- /dev/null
+++ b/kdeutils-4.7.1-job-originating-user-name.patch
@@ -0,0 +1,12 @@
+diff -up kdeutils-4.7.1/printer-applet/monitor.py.job-originating-user-name kdeutils-4.7.1/printer-applet/monitor.py
+--- kdeutils-4.7.1/printer-applet/monitor.py.job-originating-user-name	2011-09-01 16:22:40.000000000 -0500
++++ kdeutils-4.7.1/printer-applet/monitor.py	2011-09-27 10:01:41.958634749 -0500
+@@ -395,7 +395,7 @@ class Monitor:
+                         continue
+ 
+                     jobs[jobid] = attrs
+-                except AttributeError:
++                except (AttributeError, KeyError):
+                     jobs[jobid] = {'job-k-octets': 0}
+                 except cups.IPPError, (e, m):
+                     self.watcher.cups_ipp_error (self, e, m)
diff --git a/sources b/sources
index e69de29..8b63762 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+b66e859e551a10e09712217b1d160a95  printer-applet-4.7.97.tar.bz2


More information about the scm-commits mailing list