rpms/system-config-printer/devel system-config-printer-scp-git.patch, NONE, 1.1 system-config-printer.spec, 1.280, 1.281 system-config-printer-getdevices.patch, 1.3, NONE

Tim Waugh twaugh at fedoraproject.org
Wed Aug 19 17:05:16 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5955

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-scp-git.patch 
Removed Files:
	system-config-printer-getdevices.patch 
Log Message:
* Wed Aug 19 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-5
- Applied patch from 1.1.x (3f45e96):
  - Show a 'paused' emblem for rejecting/disabled printers
    (bug #518020).
  - Set appropriate tooltip when configuring printer (bug #518007).
  - Use separate thread for verifying IPP queue (part of bug #518065).
  - Better driver preference order (bug #518045).


system-config-printer-scp-git.patch:
 ChangeLog-OLD                 |    5 
 Makefile.am                   |    1 
 PhysicalDevice.py             |    3 
 ToolbarSearchEntry.py         |    2 
 applet.py                     |    3 
 authconn.py                   |    4 
 cupshelpers/cupshelpers.py    |    4 
 cupshelpers/ppds.py           |   17 
 cupspk.py                     |   78 ++++
 jobviewer.py                  |    5 
 optionwidgets.py              |    3 
 po/de.po                      |    9 
 po/hu.po                      |  731 +++++++++++++++---------------------------
 system-config-printer.py      |  147 +++++---
 timedops.py                   |    5 
 udev/udev-configure-printer.c |    4 
 16 files changed, 488 insertions(+), 533 deletions(-)

--- NEW FILE system-config-printer-scp-git.patch ---
diff -up system-config-printer-1.1.11/applet.py.scp-git system-config-printer-1.1.11/applet.py
--- system-config-printer-1.1.11/applet.py.scp-git	2009-08-07 17:42:59.000000000 +0100
+++ system-config-printer-1.1.11/applet.py	2009-08-19 17:51:49.110701234 +0100
@@ -88,7 +88,8 @@ class NewPrinterNotification(dbus.servic
     def GetReady (self):
         self.wake_up ()
         if self.getting_ready == 0:
-            viewer.set_special_statusicon (SEARCHING_ICON)
+            viewer.set_special_statusicon (SEARCHING_ICON,
+                                           tooltip=_("Configuring new printer"))
 
         self.getting_ready += 1
         gobject.timeout_add (60 * 1000, self.timeout_ready)
diff -up system-config-printer-1.1.11/authconn.py.scp-git system-config-printer-1.1.11/authconn.py
--- system-config-printer-1.1.11/authconn.py.scp-git	2009-07-21 15:10:03.000000000 +0100
+++ system-config-printer-1.1.11/authconn.py	2009-08-19 17:51:49.112701196 +0100
@@ -22,6 +22,7 @@ import cups
 import cupspk
 import gobject
 import gtk
+import os
 from errordialogs import *
 from debug import *
 
@@ -155,7 +156,8 @@ class Connection:
         cups.setUser (self._use_user)
 
         self._use_pk = ((self._server[0] == '/' or self._server == 'localhost')
-                        and not self._lock)
+                        and not self._lock
+                        and os.getuid () != 0)
         if self._use_pk:
             create_object = cupspk.Connection
         else:
diff -up system-config-printer-1.1.11/ChangeLog-OLD.scp-git system-config-printer-1.1.11/ChangeLog-OLD
--- system-config-printer-1.1.11/ChangeLog-OLD.scp-git	2009-07-21 15:10:03.000000000 +0100
+++ system-config-printer-1.1.11/ChangeLog-OLD	2009-08-19 17:51:49.101700079 +0100
@@ -1,3 +1,8 @@
+2009-08-11  Tim Waugh  <twaugh at redhat.com>
+
+	* cupshelpers/cupshelpers.py (missingPackagesAndExecutables):
+	Accept a filter of "-" (Ubuntu #411376).
+
 2009-06-23  Tim Waugh  <twaugh at redhat.com>
 
 	* system-config-printer.py (NewPrinterGUI.nextNPTab): Don't log
diff -up system-config-printer-1.1.11/cupshelpers/cupshelpers.py.scp-git system-config-printer-1.1.11/cupshelpers/cupshelpers.py
--- system-config-printer-1.1.11/cupshelpers/cupshelpers.py.scp-git	2009-08-05 11:33:24.000000000 +0100
+++ system-config-printer-1.1.11/cupshelpers/cupshelpers.py	2009-08-19 17:51:49.114700998 +0100
@@ -642,6 +642,10 @@ def missingPackagesAndExecutables(ppd):
     # First, a local function.  How to check that something exists
     # in a path:
     def pathcheck (name, path="/usr/bin:/bin"):
+        if name == "-":
+            # A filter of "-" means that no filter is required,
+            # i.e. the device accepts the given format as-is.
+            return "builtin"
         # Strip out foomatic '%'-style place-holders.
         p = name.find ('%')
         if p != -1:
diff -up system-config-printer-1.1.11/cupshelpers/ppds.py.scp-git system-config-printer-1.1.11/cupshelpers/ppds.py
--- system-config-printer-1.1.11/cupshelpers/ppds.py.scp-git	2009-08-07 17:50:41.000000000 +0100
+++ system-config-printer-1.1.11/cupshelpers/ppds.py	2009-08-19 17:51:49.116700675 +0100
@@ -180,6 +180,7 @@ def ppdMakeModelSplit (ppd_make_and_mode
                    " ps3",
                    " pxl",
                    " series",
+                   "_bt",
                    ","]:
         s = modell.find (suffix)
         if s != -1:
@@ -208,14 +209,14 @@ def ppdMakeModelSplit (ppd_make_and_mode
 # Some drivers are just generally better than others.
 # Here is the preference list:
 DRIVER_TYPE_DOWNLOADED_NOW = 5
-DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT = 8
 DRIVER_TYPE_VENDOR = 10
-DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT = 15
 DRIVER_TYPE_HPCUPS = 16
 DRIVER_TYPE_FOOMATIC_HPIJS_ON_HP = 17
 DRIVER_TYPE_GUTENPRINT_NATIVE_SIMPLIFIED = 20
 DRIVER_TYPE_GUTENPRINT_NATIVE = 25
 DRIVER_TYPE_SPLIX = 27
+DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT = 28
+DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT = 29
 DRIVER_TYPE_FOOMATIC_PS = 30
 DRIVER_TYPE_FOOMATIC_HPIJS = 40
 DRIVER_TYPE_FOOMATIC_GUTENPRINT_SIMPLIFIED = 50
@@ -229,12 +230,6 @@ def _getDriverType (ppdname, ppds=None):
     """Decides which of the above types ppdname is."""
     if ppdname.find ("turboprint") != -1:
         return DRIVER_TYPE_3RD_PARTY_NONFREE
-    if ppdname.find ("gutenprint") != -1:
-        if (ppdname.find ("/simple/") != -1 or
-            ppdname.find (".sim-") != -1):
-            return DRIVER_TYPE_GUTENPRINT_NATIVE_SIMPLIFIED
-        else:
-            return DRIVER_TYPE_GUTENPRINT_NATIVE
     if ppdname.find ("splix")!= -1:
         return DRIVER_TYPE_SPLIX
     if ppdname.find ("hpcups") != -1:
@@ -264,6 +259,12 @@ def _getDriverType (ppdname, ppds=None):
                 return DRIVER_TYPE_FOOMATIC_GUTENPRINT_SIMPLIFIED
             return DRIVER_TYPE_FOOMATIC_GUTENPRINT
         return DRIVER_TYPE_FOOMATIC
+    if ppdname.find ("gutenprint") != -1:
+        if (ppdname.find ("/simple") != -1 or
+            ppdname.find (".sim-") != -1):
+            return DRIVER_TYPE_GUTENPRINT_NATIVE_SIMPLIFIED
+        else:
+            return DRIVER_TYPE_GUTENPRINT_NATIVE
     if ppdname.find ("-hpijs") != -1:
         if ppdname.find ("hpijs-rss") == -1:
             return DRIVER_TYPE_FOOMATIC_HPIJS
diff -up system-config-printer-1.1.11/cupspk.py.scp-git system-config-printer-1.1.11/cupspk.py
--- system-config-printer-1.1.11/cupspk.py.scp-git	2009-08-05 11:33:24.000000000 +0100
+++ system-config-printer-1.1.11/cupspk.py	2009-08-19 17:51:49.119702393 +0100
@@ -1,8 +1,8 @@
 # vim: set ts=4 sw=4 et: coding=UTF-8
 #
 # Copyright (C) 2008 Novell, Inc.
-# Copyright (C) 2009, 2009 Red Hat, Inc.
-# Copyright (C) 2009, 2009 Tim Waugh <twaugh at redhat.com>
+# Copyright (C) 2008, 2009 Red Hat, Inc.
+# Copyright (C) 2008, 2009 Tim Waugh <twaugh at redhat.com>
 #
 # Authors: Vincent Untz
 #
@@ -30,7 +30,6 @@ import os
 import sys
 
 import tempfile
-import string
 
 import cups
 import dbus
@@ -152,7 +151,7 @@ class Connection:
         pk_auth_running = False
 
         if pk_auth_error != None:
-            if string.find(pk_auth_error, 'org.freedesktop.DBus.Error.NoReply') == 0:
+            if pk_auth_error.find('org.freedesktop.DBus.Error.NoReply') == 0:
                 return False
             raise dbus.exceptions.DBusException(pk_auth_error)
 
@@ -300,7 +299,74 @@ class Connection:
 #    getPPDs
 #    getServerPPD
 #    getDocument
-#    getDevices
+
+
+    def getDevices(self, *args, **kwds):
+        use_pycups = False
+
+        timeout = 0
+        include_schemes = ''
+        exclude_schemes = ''
+
+        if len(args) == 3:
+            (use_pycups, timeout, include_schemes, exclude_schemes) = self._args_to_tuple([int, str, str], *args)
+        else:
+            if kwds.has_key('timeout'):
+                timeout = kwds['timeout']
+
+            if kwds.has_key('include_schemes'):
+                include_schemes = kwds['include_schemes']
+
+            if kwds.has_key('exclude_schemes'):
+                exclude_schemes = kwds['exclude_schemes']
+
+        pk_args = (timeout, include_schemes, exclude_schemes)
+
+        result = self._call_with_pk_and_fallback(use_pycups,
+                                                 'DevicesGet', pk_args,
+                                                 self._connection.getDevices,
+                                                 *args, **kwds)
+
+        # return 'result' if fallback was called
+        if len (result.keys()) > 0 and type (result[result.keys()[0]]) == dict:
+             return result
+
+        result_str = {}
+        if result != None:
+            for i in result.keys():
+                if type(i) == dbus.String:
+                    result_str[str(i)] = str(result[i])
+                else:
+                    result_str[i] = result[i]
+
+        # cups-pk-helper returns all devices in one dictionary.
+        # Keys of different devices are distinguished by ':n' postfix.
+
+        devices = {}
+        n = 0
+        postfix = ':' + str (n)
+        device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
+        while len (device_keys) > 0:
+
[...2021 lines suppressed...]
         ppd_filter = gtk.FileFilter()
         ppd_filter.set_name(_("PostScript Printer Description files (*.ppd, *.PPD, *.ppd.gz, *.PPD.gz, *.PPD.GZ)"))
@@ -3873,7 +3896,12 @@ class NewPrinterGUI(GtkGUI):
                 self.auto_model = 'Queue'
 
             try:
-                self.loadPPDs ()
+                if self.dialog_mode == "ppd":
+                    parent = self.mainapp.PrinterPropertiesDialog
+                else:
+                    parent = self.NewPrinterWindow
+
+                self.loadPPDs (parent=parent)
             except cups.IPPError, (e, m):
                 show_IPP_Error (e, m, parent=self.mainapp.PrintersWindow)
                 return
@@ -3953,9 +3981,10 @@ class NewPrinterGUI(GtkGUI):
                                          _('Searching') + '</span>\n\n' +
                                          _('Searching for downloadable drivers'))
                 if not parent:
-                    parent = self.mainapp.PrintersWindow
+                    parent = self.NewPrinterWindow
                 self.WaitWindow.set_transient_for (parent)
                 self.WaitWindow.show ()
+                self.busy (self.WaitWindow)
 
             if self.mainapp.cups == None:
                 debugprint("CUPS connection lost, reconnecting ...")
@@ -4032,9 +4061,10 @@ class NewPrinterGUI(GtkGUI):
                                          _('Searching') + '</span>\n\n' +
                                          _('Searching for drivers'))
                 if not parent:
-                    parent = self.mainapp.PrintersWindow
+                    parent = self.NewPrinterWindow
                 self.WaitWindow.set_transient_for (parent)
-                self.WaitWindow.show_now ()
+                self.WaitWindow.show ()
+                self.busy (self.WaitWindow)
 
             while gtk.events_pending ():
                 gtk.main_iteration ()
@@ -4347,6 +4377,7 @@ class NewPrinterGUI(GtkGUI):
                                          _('Searching for drivers'))
                 self.WaitWindow.set_transient_for (self.NewPrinterWindow)
                 self.WaitWindow.show ()
+                self.busy (self.WaitWindow)
                 self.busy (self.NewPrinterWindow)
 
                 # Keep the UI refreshed while we wait for the drivers
@@ -4547,6 +4578,7 @@ class NewPrinterGUI(GtkGUI):
             parent = self.mainapp.PrintersWindow
         self.WaitWindow.set_transient_for (parent)
         self.WaitWindow.show_now ()
+        self.busy (self.WaitWindow)
         while gtk.events_pending ():
             gtk.main_iteration ()
 
@@ -4629,7 +4661,7 @@ class NewPrinterGUI(GtkGUI):
             return True # assume plugin not required
         # Check whether the plugin is already installed
         if hplip_version.startswith("3"):
-            os.environ["hp_model"] = hpmodel;
+            os.environ["hp_model"] = hpmodel
             cmd = 'LC_ALL=C hp-mkuri -c'
             debugprint (uri + ": " + hpmodel)
             try:
@@ -5397,22 +5429,36 @@ class NewPrinterGUI(GtkGUI):
         verified = False
         if hostport != None:
             (host, port) = urllib.splitnport (hostport, defport=631)
-            oldserver = cups.getServer ()
-            try:
-                if uri.startswith ("https:"):
-                    encryption = cups.HTTP_ENCRYPT_ALWAYS
-                else:
-                    encryption = cups.HTTP_ENCRYPT_IF_REQUESTED
+            if uri.startswith ("https:"):
+                encryption = cups.HTTP_ENCRYPT_ALWAYS
+            else:
+                encryption = cups.HTTP_ENCRYPT_IF_REQUESTED
 
+            def get_attributes():
                 c = cups.Connection (host=host, port=port,
                                      encryption=encryption)
-                attributes = c.getPrinterAttributes (uri = uri)
+                return c.getPrinterAttributes (uri=uri)
+                
+            op = TimedOperation (get_attributes)
+            self.lblWait.set_markup ('<span weight="bold" size="larger">' +
+                                     _('Verifying') + '</span>\n\n' +
+                                     _('Verifying printer'))
+            self.WaitWindow.set_transient_for (self.NewPrinterWindow)
+            self.WaitWindow.show ()
+            self.busy (self.WaitWindow)
+            source = gobject.timeout_add (10000, op.cancel)
+            try:
+                attributes = op.run ()
                 verified = True
+            except OperationCanceled:
+                pass
             except cups.IPPError, (e, msg):
                 debugprint ("Failed to get attributes: %s (%d)" % (msg, e))
             except:
                 nonfatalException ()
-            cups.setServer (oldserver)
+
+            gobject.source_remove (source)
+            self.WaitWindow.hide ()
         else:
             debugprint (uri)
 
@@ -5733,6 +5779,7 @@ class NewPrinterGUI(GtkGUI):
                                  _('Searching for printers'))
         self.WaitWindow.set_transient_for (self.NewPrinterWindow)
         self.WaitWindow.show_now ()
+        self.busy (self.WaitWindow)
         printers = server.probe()
         self.WaitWindow.hide ()
 
@@ -6131,14 +6178,26 @@ class NewPrinterGUI(GtkGUI):
                 model.append((driver, ))
         self.tvNPDrivers.columns_autosize()
 
-    def NPDriversTooltips(self, model, path, col):
+    def on_NPDrivers_query_tooltip(self, tv, x, y, keyboard_mode, tooltip):
+        if keyboard_mode:
+            path = tv.get_cursor()[0]
+            if path is None:
+                return False
+        else:
+            bin_x, bin_y = tv.convert_widget_to_bin_window_coords(x, y)
+            ret = tv.get_path_at_pos (bin_x, bin_y)
+            if ret is None:
+                return False
+            path = ret[0]
+
         drivername = self.NPDrivers[path[0]]
         ppddict = self.ppds.getInfoFromPPDName(drivername)
         markup = ppddict['ppd-make-and-model']
         if (drivername.startswith ("foomatic:")):
             markup += " "
             markup += _("This PPD is generated by foomatic.")
-        return markup
+        tooltip.set_markup(markup)
+        return True
 
     def on_tvNPModels_cursor_changed(self, widget):
         path, column = widget.get_cursor()
diff -up system-config-printer-1.1.11/timedops.py.scp-git system-config-printer-1.1.11/timedops.py
--- system-config-printer-1.1.11/timedops.py.scp-git	2009-07-21 15:10:03.000000000 +0100
+++ system-config-printer-1.1.11/timedops.py	2009-08-19 17:51:49.150700369 +0100
@@ -32,7 +32,7 @@ class Timed:
         pass
 
     def cancel (self):
-        pass
+        return False
 
 class TimedSubprocess(Timed):
     def __init__ (self, timeout=60000, parent=None, show_dialog=True,
@@ -119,6 +119,8 @@ class TimedSubprocess(Timed):
             gtk.main_quit ()
             self.watchers = 0
 
+        return False
+
 class OperationThread(threading.Thread):
     def __init__ (self, target=None, args=(), kwargs={}):
         threading.Thread.__init__ (self)
@@ -200,3 +202,4 @@ class TimedOperation(Timed):
     def cancel (self):
         debugprint ("Command canceled")
         gtk.main_quit ()
+        return False
diff -up system-config-printer-1.1.11/ToolbarSearchEntry.py.scp-git system-config-printer-1.1.11/ToolbarSearchEntry.py
--- system-config-printer-1.1.11/ToolbarSearchEntry.py.scp-git	2009-07-21 15:10:03.000000000 +0100
+++ system-config-printer-1.1.11/ToolbarSearchEntry.py	2009-08-19 17:51:49.108701241 +0100
@@ -68,7 +68,7 @@ class ToolbarSearchEntry (gtk.HBox):
         label = gtk.Label ()
         label.set_text_with_mnemonic (_("_Filter:"))
         label.set_justify (gtk.JUSTIFY_RIGHT)
-        self.pack_start (label, False, True, 0);
+        self.pack_start (label, False, True, 0)
 
         self.entry = gtk.Entry()
         if gtk.__dict__.has_key ('ENTRY_ICON_PRIMARY'):
diff -up system-config-printer-1.1.11/udev/udev-configure-printer.c.scp-git system-config-printer-1.1.11/udev/udev-configure-printer.c
--- system-config-printer-1.1.11/udev/udev-configure-printer.c.scp-git	2009-08-07 17:42:55.000000000 +0100
+++ system-config-printer-1.1.11/udev/udev-configure-printer.c	2009-08-19 17:51:49.153701536 +0100
@@ -791,8 +791,8 @@ find_matching_device_uris (struct device
 
       /* Now check the manufacturer and model names. */
       if (device_uri && this_id.mfg && this_id.mdl &&
-	  !strcmp (this_id.mfg, id->mfg) &&
-	  !strcmp (this_id.mdl, id->mdl))
+	  !strcasecmp (this_id.mfg, id->mfg) &&
+	  !strcasecmp (this_id.mdl, id->mdl))
 	{
 	  /* We've checked everything except the serial numbers.  This
 	   * is more complicated.  Some devices include a serial


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.280
retrieving revision 1.281
diff -u -p -r1.280 -r1.281
--- system-config-printer.spec	14 Aug 2009 15:03:14 -0000	1.280
+++ system-config-printer.spec	19 Aug 2009 17:05:16 -0000	1.281
@@ -7,15 +7,14 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.11
-Release: 4%{?dist}
+Release: 5%{?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.1/system-config-printer-%{version}.tar.xz
 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
-Patch1: system-config-printer-getdevices.patch
-Patch2: system-config-printer-hplip-hack.patch
+Patch1: system-config-printer-scp-git.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -26,6 +25,7 @@ BuildRequires: intltool
 BuildRequires: libusb-devel, libudev-devel
 BuildRequires: xmlto
 BuildRequires: epydoc
+BuildRequires: autoconf, automake
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -76,8 +76,11 @@ printers.
 
 %prep
 %setup -q -a 1 -a 2
-%patch1 -p1 -b .getdevices
-%patch2 -p1 -b .hplip-hack
+# Applied patch from 1.1.x (3f45e96).
+%patch1 -p1 -b .scp-git
+aclocal
+automake --copy --add-missing
+autoconf
 
 %build
 %configure --with-udev-rules
@@ -173,7 +176,6 @@ rm -rf %buildroot
 %{_datadir}/%{name}/userdefault.py*
 %{_datadir}/%{name}/XmlHelper.py*
 %{_datadir}/%{name}/gtk_label_autowrap.py*
-%{_datadir}/%{name}/gtk_treeviewtooltips.py*
 %{_datadir}/%{name}/applet.py*
 %{_datadir}/%{name}/troubleshoot
 %{_datadir}/%{name}/icons
@@ -190,6 +192,14 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Wed Aug 19 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-5
+- Applied patch from 1.1.x (3f45e96):
+  - Show a 'paused' emblem for rejecting/disabled printers
+    (bug #518020).
+  - Set appropriate tooltip when configuring printer (bug #518007).
+  - Use separate thread for verifying IPP queue (part of bug #518065).
+  - Better driver preference order (bug #518045).
+
 * Fri Aug 14 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-4
 - Compare MFG and MDL fields case insensitively when adding automatic
   queues, because HPLIP provides them with different case than the


--- system-config-printer-getdevices.patch DELETED ---




More information about the fedora-extras-commits mailing list