[Printing-architecture] [Printing-japan] Ubuntu Natty the first distribution which does automatic download of binary printer driver packages

Tim Waugh twaugh at redhat.com
Fri Mar 11 08:59:15 PST 2011


On Fri, 2011-03-11 at 17:15 +0100, Till Kamppeter wrote:
> Tim, the patch to fix this (and which I have applied to the Ubuntu 
> package) is attached./ Please apply it also upstream. Thanks.

Thanks.  Actually some of these are incorrect, so I've applied a patch
that fixes the correct part and have removed the incorrect code.

diff --git a/newprinter.py b/newprinter.py
index 0d58a40..fa113cc 100644
--- a/newprinter.py
+++ b/newprinter.py
@@ -637,6 +637,8 @@ class NewPrinterGUI(GtkGUI):
 
             if self.dialog_mode == "ppd":
                 devid = self.device.id
+                if not self.devid:
+                    self.devid = devid
 
             if not devid:
                 devid = None

This entire block is stale code I think.  If self.dialog_mode is "ppd",
self.device.id is definitely unset (we only created self.device a few
lines above).

@@ -655,6 +657,8 @@ class NewPrinterGUI(GtkGUI):
                                         include_schemes=schemes,
                                         reply_handler=self.change_ppd_got_devs,
                                         error_handler=self.change_ppd_got_devs)
+                if self.devid:
+                    devid = self.devid

No, that's not right.  The reason is that the getDevices() call
immediately above these new lines is asynchronous.  The reason we're
calling getDevices() at all here is precisely in order to get the Device
ID for the device we're changing the PPD of, because we don't already
have it.

Here's the patch that fixes the problem.  Another patch is in master
that removes the stale code.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Ensure-all-uses-of-ppdsloader-supply-the-Device-ID.patch
Type: text/x-patch
Size: 1029 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/printing-architecture/attachments/20110311/3617c525/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://lists.linux-foundation.org/pipermail/printing-architecture/attachments/20110311/3617c525/attachment.pgp 


More information about the Printing-architecture mailing list