This commit is contained in:
Tim Waugh 2013-08-20 11:51:28 +01:00
parent 50bb6e5065
commit 933f06c386
26 changed files with 11 additions and 1681 deletions

1
.gitignore vendored
View File

@ -244,3 +244,4 @@ pycups-1.9.51.tar.bz2
/system-config-printer-1.3.13.tar.xz
/system-config-printer-1.4.0.tar.xz
/system-config-printer-1.4.1.tar.xz
/system-config-printer-1.4.2.tar.xz

View File

@ -1 +1 @@
3d794eb88c5813c3024b181677a602dd system-config-printer-1.4.1.tar.xz
7f6462d84056be13aadeb6e3030aad5e system-config-printer-1.4.2.tar.xz

Binary file not shown.

View File

@ -1,12 +0,0 @@
diff -up system-config-printer-1.4.1/jobviewer.py.misplaced-paren system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.misplaced-paren 2013-07-02 12:54:47.487847459 +0100
+++ system-config-printer-1.4.1/jobviewer.py 2013-07-02 12:56:17.649270440 +0100
@@ -1953,7 +1953,7 @@ class JobViewer (GtkGUI):
if notify_text.find ("backend errors") != -1:
message = (_("There was a problem sending document `%s' "
"(job %d) to the printer.") %
- (document.encode ('utf-8', jobid)))
+ (document.encode ('utf-8'), jobid))
elif notify_text.find ("filter errors") != -1:
message = _("There was a problem processing document `%s' "
"(job %d).") % (document.encode ('utf-8'),

View File

@ -1,7 +1,7 @@
diff -up system-config-printer-1.3.2/print-applet.desktop.in.no-applet-in-gnome system-config-printer-1.3.2/print-applet.desktop.in
--- system-config-printer-1.3.2/print-applet.desktop.in.no-applet-in-gnome 2011-03-22 16:52:27.022333561 +0000
+++ system-config-printer-1.3.2/print-applet.desktop.in 2011-03-22 16:57:39.782439447 +0000
@@ -6,6 +6,6 @@ Exec=system-config-printer-applet
diff -up system-config-printer-1.4.2/print-applet.desktop.in.no-applet-in-gnome system-config-printer-1.4.2/print-applet.desktop.in
--- system-config-printer-1.4.2/print-applet.desktop.in.no-applet-in-gnome 2013-05-31 17:35:03.000000000 +0100
+++ system-config-printer-1.4.2/print-applet.desktop.in 2013-08-20 11:37:28.663703579 +0100
@@ -5,6 +5,6 @@ Exec=system-config-printer-applet
Terminal=false
Type=Application
Icon=printer

View File

@ -1,73 +0,0 @@
diff -up system-config-printer-1.4.1/applet.py.notification-new system-config-printer-1.4.1/applet.py
--- system-config-printer-1.4.1/applet.py.notification-new 2013-06-20 10:29:22.210332443 +0200
+++ system-config-printer-1.4.1/applet.py 2013-06-20 10:31:35.804055082 +0200
@@ -80,9 +80,9 @@ class NewPrinterNotification(dbus.servic
def GetReady (self):
TIMEOUT=1200000
if self.getting_ready == 0:
- n = Notify.Notification (_("Configuring new printer"),
- _("Please wait..."),
- 'printer')
+ n = Notify.Notification.new (_("Configuring new printer"),
+ _("Please wait..."),
+ 'printer')
n.set_timeout (TIMEOUT + 5000)
n.closed = False
n.connect ('closed', self.on_notification_closed)
@@ -120,7 +120,7 @@ class NewPrinterNotification(dbus.servic
text = _("No printer driver for %s.") % device
else:
text = _("No driver for this printer.")
- n = Notify.Notification (title, text, 'printer')
+ n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.CRITICAL)
n.set_timeout (Notify.EXPIRES_NEVER)
@@ -169,7 +169,7 @@ class NewPrinterNotification(dbus.servic
pkgs = reduce (lambda x,y: x + ", " + y, missing_pkgs)
title = _("Install printer driver")
text = _("`%s' requires driver installation: %s.") % (name, pkgs)
- n = Notify.Notification (title, text)
+ n = Notify.Notification.new (title, text, 'printer')
import installpackage
if "actions" in Notify.get_server_caps():
try:
@@ -192,7 +192,7 @@ class NewPrinterNotification(dbus.servic
elif status == self.STATUS_SUCCESS:
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
text = _("`%s' is ready for printing.") % name
- n = Notify.Notification (title, text)
+ n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.NORMAL)
n.add_action ("test-page", _("Print test page"),
@@ -204,7 +204,7 @@ class NewPrinterNotification(dbus.servic
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
text = (_("`%s' has been added, using the `%s' driver.") %
(name, driver))
- n = Notify.Notification (title, text, 'printer')
+ n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.CRITICAL)
n.add_action ("test-page", _("Print test page"),
diff -up system-config-printer-1.4.1/jobviewer.py.notification-new system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.notification-new 2013-06-20 10:29:22.211332429 +0200
+++ system-config-printer-1.4.1/jobviewer.py 2013-06-20 10:29:22.224332252 +0200
@@ -1731,7 +1731,7 @@ class JobViewer (GtkGUI):
urgency = Notify.Urgency.LOW
(title, text) = reason.get_description ()
- notification = Notify.Notification (title, text, 'printer')
+ notification = Notify.Notification.new (title, text, 'printer')
reason.user_notified = True
notification.set_urgency (urgency)
if self.notify_has_actions:
@@ -1784,7 +1784,7 @@ class JobViewer (GtkGUI):
return
printer = job.get ('job-printer-name', _("Unknown"))
- notification = Notify.Notification (_("Document printed"),
+ notification = Notify.Notification.new (_("Document printed"),
_("Document `%s' has been sent "
"to `%s' for printing.") %
(document.encode ('utf-8'),

View File

@ -1,54 +0,0 @@
diff -up system-config-printer-1.4.1/applet.py.notify-urgency system-config-printer-1.4.1/applet.py
--- system-config-printer-1.4.1/applet.py.notify-urgency 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/applet.py 2013-06-06 17:10:15.619536855 +0100
@@ -122,7 +122,7 @@ class NewPrinterNotification(dbus.servic
text = _("No driver for this printer.")
n = Notify.Notification (title, text, 'printer')
if "actions" in Notify.get_server_caps():
- n.set_urgency (Notify.URGENCY_CRITICAL)
+ n.set_urgency (Notify.Urgency.CRITICAL)
n.set_timeout (Notify.EXPIRES_NEVER)
n.add_action ("setup-printer", _("Search"),
lambda x, y:
@@ -194,7 +194,7 @@ class NewPrinterNotification(dbus.servic
text = _("`%s' is ready for printing.") % name
n = Notify.Notification (title, text)
if "actions" in Notify.get_server_caps():
- n.set_urgency (Notify.URGENCY_NORMAL)
+ n.set_urgency (Notify.Urgency.NORMAL)
n.add_action ("test-page", _("Print test page"),
lambda x, y:
self.print_test_page (x, y, name))
@@ -206,7 +206,7 @@ class NewPrinterNotification(dbus.servic
(name, driver))
n = Notify.Notification (title, text, 'printer')
if "actions" in Notify.get_server_caps():
- n.set_urgency (Notify.URGENCY_CRITICAL)
+ n.set_urgency (Notify.Urgency.CRITICAL)
n.add_action ("test-page", _("Print test page"),
lambda x, y:
self.print_test_page (x, y, name, devid))
diff -up system-config-printer-1.4.1/jobviewer.py.notify-urgency system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.notify-urgency 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/jobviewer.py 2013-06-06 17:10:15.619536855 +0100
@@ -1724,9 +1724,9 @@ class JobViewer (GtkGUI):
level = reason.get_level ()
if (level == StateReason.ERROR or
reason.get_reason () == "connecting-to-device"):
- urgency = Notify.URGENCY_NORMAL
+ urgency = Notify.Urgency.NORMAL
else:
- urgency = Notify.URGENCY_LOW
+ urgency = Notify.Urgency.LOW
(title, text) = reason.get_description ()
notification = Notify.Notification (title, text, 'printer')
@@ -1788,7 +1788,7 @@ class JobViewer (GtkGUI):
(document.encode ('utf-8'),
printer.encode ('utf-8')),
'printer')
- notification.set_urgency (Notify.URGENCY_LOW)
+ notification.set_urgency (Notify.Urgency.LOW)
notification.connect ('closed',
self.on_completed_job_notification_closed)
notification.jobid = jobid

View File

@ -1,21 +0,0 @@
diff -up system-config-printer-1.4.1/newprinter.py.np-traceback system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.np-traceback 2013-06-07 12:40:22.819125802 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-06-07 12:40:35.549191403 +0100
@@ -868,7 +868,7 @@ class NewPrinterGUI(GtkGUI):
if self.ppdsloader:
self.ppdsloader.destroy ()
- self.ppds_loader = None
+ self.ppdsloader = None
if self.printer_finder:
self.printer_finder.cancel ()
@@ -3418,7 +3418,7 @@ class NewPrinterGUI(GtkGUI):
def on_tvNPMakes_cursor_changed(self, tvNPMakes):
path, column = tvNPMakes.get_cursor()
- if path != None:
+ if path != None and self.ppds != None:
model = tvNPMakes.get_model ()
iter = model.get_iter (path)
self.NPMake = model.get(iter, 1)[0]

View File

@ -1,32 +0,0 @@
diff -up system-config-printer-1.4.1/pysmb.py.pointer-grab system-config-printer-1.4.1/pysmb.py
--- system-config-printer-1.4.1/pysmb.py.pointer-grab 2013-05-09 12:10:45.000000000 +0100
+++ system-config-printer-1.4.1/pysmb.py 2013-06-06 17:13:43.906581683 +0100
@@ -3,7 +3,7 @@
## system-config-printer
## CUPS backend
-## Copyright (C) 2002, 2003, 2006, 2007, 2008, 2010, 2012 Red Hat, Inc.
+## Copyright (C) 2002, 2003, 2006, 2007, 2008, 2010, 2012, 2013 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
@@ -23,7 +23,6 @@
import errno
from gettext import gettext as _
-from gi.repository import Gdk
from gi.repository import Gtk
import os
import pwd
@@ -145,11 +144,7 @@ class AuthContext:
domain_entry.set_text (self.use_workgroup)
d.set_keep_above (True)
- Gdk.pointer_grab (d.get_window(), True)
- Gdk.keyboard_grab (d.get_window(), True)
response = d.run ()
- Gdk.keyboard_ungrab ()
- Gdk.pointer_ungrab ()
if response == Gtk.ResponseType.CANCEL:
self.cancel = True

View File

@ -1,71 +0,0 @@
diff -up system-config-printer-1.4.1/newprinter.py.remote-missing system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.remote-missing 2013-07-02 12:47:40.326084898 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-07-02 12:48:29.943214126 +0100
@@ -3894,9 +3894,6 @@ class NewPrinterGUI(GtkGUI):
else:
name = self._name
- # Whether to check for missing drivers.
- check = False
- checkppd = None
ppd = self.ppd
if self.dialog_mode == "class":
@@ -3936,7 +3933,6 @@ class NewPrinterGUI(GtkGUI):
if isinstance(ppd, str) or isinstance(ppd, unicode):
self.cups.addPrinter(name, ppdname=ppd,
device=uri, info=info, location=location)
- check = True
elif ppd is None: # raw queue
self.cups.addPrinter(name, device=uri,
info=info, location=location)
@@ -3944,8 +3940,6 @@ class NewPrinterGUI(GtkGUI):
cupshelpers.setPPDPageSize(ppd, self.language[0])
self.cups.addPrinter(name, ppd=ppd, device=uri,
info=info, location=location)
- check = True
- checkppd = ppd
except cups.IPPError, (e, msg):
ready (self.NewPrinterWindow)
self.show_IPP_Error(e, msg)
@@ -4041,10 +4035,6 @@ class NewPrinterGUI(GtkGUI):
self.cups._end_operation ()
- if not raw:
- check = True
- checkppd = ppd
-
self.NewPrinterWindow.hide()
if self.dialog_mode in ["printer", "printer_with_uri", "class"]:
self.emit ('printer-added', name)
diff -up system-config-printer-1.4.1/system-config-printer.py.remote-missing system-config-printer-1.4.1/system-config-printer.py
--- system-config-printer-1.4.1/system-config-printer.py.remote-missing 2013-07-02 12:47:40.328085296 +0100
+++ system-config-printer-1.4.1/system-config-printer.py 2013-07-02 12:48:29.944214283 +0100
@@ -1846,20 +1846,19 @@ class GUI(GtkGUI):
iter = model.iter_next (iter)
- # Finally, suggest printing a test page.
+ # Any missing drivers?
self.propertiesDlg.load (name)
- if self.propertiesDlg.ppd or \
- ((self.propertiesDlg.printer.remote or \
- ((self.propertiesDlg.printer.device_uri.startswith('dnssd:') or \
- self.propertiesDlg.printer.device_uri.startswith('mdns:')) and \
- self.propertiesDlg.printer.device_uri.endswith('/cups'))) and not\
- self.propertiesDlg.printer.discovered):
+ if (self.propertiesDlg.ppd and
+ not (self.propertiesDlg.printer.discovered or
+ self.propertiesDlg.printer.remote)):
try:
self.checkDriverExists (self.PrintersWindow, name,
ppd=self.propertiesDlg.ppd)
except:
nonfatalException()
+ # Finally, suggest printing a test page.
+ if self.propertiesDlg.ppd:
q = Gtk.MessageDialog (self.PrintersWindow,
Gtk.DialogFlags.DESTROY_WITH_PARENT |
Gtk.DialogFlags.MODAL,

View File

@ -1,14 +0,0 @@
diff -up system-config-printer-1.4.1/system-config-printer.py.rename-race system-config-printer-1.4.1/system-config-printer.py
--- system-config-printer-1.4.1/system-config-printer.py.rename-race 2013-07-02 12:49:47.708150432 +0100
+++ system-config-printer-1.4.1/system-config-printer.py 2013-07-02 12:50:22.388173828 +0100
@@ -1278,6 +1278,10 @@ class GUI(GtkGUI):
return
(res, path, cell) = tuple
+ if path == None:
+ # Printer removed?
+ return
+
if type (cell) != Gtk.CellRendererText:
cells = self.dests_iconview.get_cells ()
for cell in cells:

View File

@ -1,75 +0,0 @@
diff -up system-config-printer-1.4.1/system-config-printer.py.rename system-config-printer-1.4.1/system-config-printer.py
--- system-config-printer-1.4.1/system-config-printer.py.rename 2013-05-09 12:10:45.000000000 +0100
+++ system-config-printer-1.4.1/system-config-printer.py 2013-06-07 16:57:05.066174697 +0100
@@ -1296,18 +1296,27 @@ class GUI(GtkGUI):
ids = []
ids.append (cell.connect ('editing-started',
self.printer_name_edit_start))
- ids.append (cell.connect ('edited', self.printer_name_edited))
ids.append (cell.connect ('editing-canceled',
self.printer_name_edit_cancel))
self.rename_sigids = ids
- self.rename_entry_sigid = None
+ self.rename_entry_sigids = []
self.dests_iconview.set_cursor (path, cell, True)
def printer_name_edit_start (self, cell, editable, path):
- debugprint ("editing-started")
+ debugprint ("editing-started with cell=%s, editable=%s" %
+ (repr (cell),
+ repr (editable)))
if isinstance(editable, Gtk.Entry):
id = editable.connect('changed', self.printer_name_editing)
- self.rename_entry_sigid = editable, id
+ self.rename_entry_sigids.append ((editable, id))
+
+ model = self.dests_iconview.get_model ()
+ iter = model.get_iter (path)
+ name = model.get_value (iter, 2).decode ('utf-8')
+ id = editable.connect('editing-done',
+ self.printer_name_editing_done,
+ cell, name)
+ self.rename_entry_sigids.append ((editable, id))
def printer_name_editing (self, entry):
newname = origname = unicode (entry.get_text())
@@ -1318,11 +1327,10 @@ class GUI(GtkGUI):
debugprint ("removed disallowed character %s" % origname[-1])
entry.set_text(newname)
- def printer_name_edited (self, cell, path, newname):
- model = self.dests_iconview.get_model ()
- iter = model.get_iter (path)
- name = model.get_value (iter, 2).decode ('utf-8')
- debugprint ("edited: %s -> %s" % (name, newname))
+ def printer_name_editing_done (self, entry, cell, name):
+ debugprint (repr (cell))
+ newname = entry.get_text ().decode ('utf-8')
+ debugprint ("edited: %s -> %s" % (repr (name), repr (newname)))
try:
self.rename_printer (name, newname)
finally:
@@ -1330,18 +1338,17 @@ class GUI(GtkGUI):
cell.set_property ('editable', False)
for id in self.rename_sigids:
cell.disconnect (id)
- if self.rename_entry_sigid != None:
- self.rename_entry_sigid[0].disconnect(self.rename_entry_sigid[1])
+ for obj, id in self.rename_entry_sigids:
+ obj.disconnect (id)
def printer_name_edit_cancel (self, cell):
- debugprint ("editing-canceled")
+ debugprint ("editing-canceled (%s)" % repr (cell))
cell.stop_editing (True)
cell.set_property ('editable', False)
for id in self.rename_sigids:
cell.disconnect (id)
- if self.rename_entry_sigid != None:
- self.rename_entry_sigid[0].disconnect(self.rename_entry_sigid[1])
-
+ for obj, id in self.rename_entry_sigids:
+ obj.disconnect (id)
def rename_printer (self, old_name, new_name):
if old_name.lower() == new_name.lower():

View File

@ -1,32 +0,0 @@
diff -up system-config-printer-1.4.1/jobviewer.py.statusicon-geometry system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.statusicon-geometry 2013-07-02 12:44:38.076105142 +0100
+++ system-config-printer-1.4.1/jobviewer.py 2013-07-02 12:44:54.770626200 +0100
@@ -683,16 +683,19 @@ class JobViewer (GtkGUI):
if visible:
w = self.JobsWindow.get_window()
aw = self.JobsAttributesWindow.get_window()
- (s, area, o) = self.statusicon.get_geometry ()
- w.set_skip_taskbar_hint (True)
- if aw != None:
- aw.set_skip_taskbar_hint (True)
+ (loc, s, area, o) = self.statusicon.get_geometry ()
- w.property_change ("_NET_WM_ICON_GEOMETRY",
- "CARDINAL", 32,
- Gdk.PROP_MODE_REPLACE,
- list (area))
- self.JobsWindow.iconify ()
+ if loc:
+ w.set_skip_taskbar_hint (True)
+ if aw != None:
+ aw.set_skip_taskbar_hint (True)
+ w.property_change ("_NET_WM_ICON_GEOMETRY",
+ "CARDINAL", 32,
+ Gdk.PROP_MODE_REPLACE,
+ list (area))
+ self.JobsWindow.iconify ()
+ else:
+ self.JobsWindow.set_visible (False)
else:
self.JobsWindow.present ()
self.JobsWindow.set_skip_taskbar_hint (False)

View File

@ -1,12 +0,0 @@
diff -up system-config-printer-1.4.1/asyncipp.py.typo system-config-printer-1.4.1/asyncipp.py
--- system-config-printer-1.4.1/asyncipp.py.typo 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/asyncipp.py 2013-05-21 17:22:48.691678684 +0100
@@ -354,7 +354,7 @@ class _IPPAuthOperation:
self._reconnect = False
self._reconnected = True
debugprint ("%s (_error_handler): reconnecting (as %s)..." %
- (self, self_user))
+ (self, self._user))
conn.reconnect (self._user,
reply_handler=self._reconnect_reply,
error_handler=self._reconnect_error)

View File

@ -1,25 +0,0 @@
diff -up system-config-printer-1.4.1/cupshelpers/cupshelpers.py.utf8-961882 system-config-printer-1.4.1/cupshelpers/cupshelpers.py
--- system-config-printer-1.4.1/cupshelpers/cupshelpers.py.utf8-961882 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/cupshelpers/cupshelpers.py 2013-05-21 17:19:30.156816163 +0100
@@ -526,6 +526,11 @@ class Device:
self.id = kw.get('device-id', '')
self.location = kw.get('device-location', '')
+ if type (self.info) == unicode:
+ # Convert unicode objects to UTF-8 encoding so they can be
+ # compared with other UTF-8 encoded strings (bug #957444).
+ self.info = self.info.encode ('utf-8')
+
uri_pieces = uri.split(":")
self.type = uri_pieces[0]
self.is_class = len(uri_pieces)==1
@@ -610,8 +615,7 @@ class Device:
return -1
result = cmp(bool(self.id), bool(other.id))
if not result:
- result = cmp(self.info.encode ('utf-8'),
- other.info.encode ('utf-8'))
+ result = cmp(self.info, other.info)
return result

View File

@ -1,62 +0,0 @@
diff -up system-config-printer-1.4.1/newprinter.py.utf8-962207 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-962207 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-05-21 17:20:20.852036184 +0100
@@ -1632,7 +1632,7 @@ class NewPrinterGUI(GtkGUI):
def on_entNPName_changed(self, widget):
# restrict
- text = unicode (widget.get_text())
+ text = unicode (widget.get_text(), locale.getpreferredencoding ())
new_text = text
new_text = new_text.replace("/", "")
new_text = new_text.replace("#", "")
@@ -2516,7 +2516,7 @@ class NewPrinterGUI(GtkGUI):
allowed_chars = unicode (allowed_chars, locale.getpreferredencoding())
except UnicodeDecodeError:
allowed_chars = unicode (allowed_chars)
- origtext = unicode (entry.get_text())
+ origtext = unicode (entry.get_text(), locale.getpreferredencoding ())
new_text = origtext
for char in origtext:
if char not in allowed_chars:
@@ -3881,9 +3881,10 @@ class NewPrinterGUI(GtkGUI):
self.dec_spinner_task ()
if self.dialog_mode in ("class", "printer", "printer_with_uri"):
- name = unicode (self.entNPName.get_text())
- location = unicode (self.entNPLocation.get_text())
- info = unicode (self.entNPDescription.get_text())
+ enc = locale.getpreferredencoding ()
+ name = unicode (self.entNPName.get_text(), enc)
+ location = unicode (self.entNPLocation.get_text(), enc)
+ info = unicode (self.entNPDescription.get_text(), enc)
else:
name = self._name
diff -up system-config-printer-1.4.1/printerproperties.py.utf8-962207 system-config-printer-1.4.1/printerproperties.py
--- system-config-printer-1.4.1/printerproperties.py.utf8-962207 2013-05-09 12:10:45.000000000 +0100
+++ system-config-printer-1.4.1/printerproperties.py 2013-05-21 17:20:20.853036185 +0100
@@ -683,6 +683,9 @@ class PrinterPropertiesDialog(GtkGUI):
old_value = old_values[widget]
+ if type (old_value) == unicode:
+ old_value = old_value.encode (locale.getpreferredencoding ())
+
if old_value == value:
self.changed.discard(widget)
else:
@@ -1034,9 +1037,10 @@ class PrinterPropertiesDialog(GtkGUI):
for member in old_members:
self.cups.deletePrinterFromClass(member, name)
- location = self.entPLocation.get_text()
- info = self.entPDescription.get_text()
- device_uri = self.entPDevice.get_text()
+ enc = locale.getpreferredencoding ()
+ location = self.entPLocation.get_text().decode (enc)
+ info = self.entPDescription.get_text().decode (enc)
+ device_uri = self.entPDevice.get_text().decode (enc)
enabled = self.chkPEnabled.get_active()
accepting = self.chkPAccepting.get_active()

View File

@ -1,30 +0,0 @@
diff -up system-config-printer-1.4.1/statereason.py.utf8-964673 system-config-printer-1.4.1/statereason.py
--- system-config-printer-1.4.1/statereason.py.utf8-964673 2013-02-19 16:18:36.000000000 +0000
+++ system-config-printer-1.4.1/statereason.py 2013-05-21 17:20:50.123163282 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/python
-## Copyright (C) 2007, 2008, 2009, 2010, 2012 Red Hat, Inc.
+## Copyright (C) 2007, 2008, 2009, 2010, 2012, 2013 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
## Jiri Popelka <jpopelka@redhat.com>
@@ -121,7 +121,7 @@ class StateReason:
try:
(title, text) = messages[self.get_reason ()]
try:
- text = text % self.get_printer ()
+ text = text.decode ('utf-8') % self.get_printer ()
except TypeError:
# Probably an incorrect translation, missing a '%s'.
pass
@@ -148,7 +148,8 @@ class StateReason:
except RuntimeError:
pass
- text = _("Printer '%s': '%s'.") % (self.get_printer (), reason)
+ text = (_("Printer '%s': '%s'.").decode ('utf-8') %
+ (self.get_printer (), reason))
return (title, text)
def get_tuple (self):

View File

@ -1,32 +0,0 @@
diff -up system-config-printer-1.4.1/printerproperties.py.utf8-965578 system-config-printer-1.4.1/printerproperties.py
--- system-config-printer-1.4.1/printerproperties.py.utf8-965578 2013-05-21 17:20:20.853036185 +0100
+++ system-config-printer-1.4.1/printerproperties.py 2013-05-21 17:21:56.763452869 +0100
@@ -65,10 +65,14 @@ class PrinterPropertiesDialog(GtkGUI):
'dialog-closed': ( GObject.SIGNAL_RUN_LAST, None, ()),
}
- printer_states = { cups.IPP_PRINTER_IDLE: _("Idle"),
- cups.IPP_PRINTER_PROCESSING: _("Processing"),
- cups.IPP_PRINTER_BUSY: _("Busy"),
- cups.IPP_PRINTER_STOPPED: _("Stopped") }
+ printer_states = { cups.IPP_PRINTER_IDLE:
+ _("Idle").decode ('utf-8'),
+ cups.IPP_PRINTER_PROCESSING:
+ _("Processing").decode ('utf-8'),
+ cups.IPP_PRINTER_BUSY:
+ _("Busy").decode ('utf-8'),
+ cups.IPP_PRINTER_STOPPED:
+ _("Stopped").decode ('utf-8') }
def __init__(self):
GObject.GObject.__init__ (self)
@@ -1635,7 +1639,8 @@ class PrinterPropertiesDialog(GtkGUI):
debugprint ("update printer properties")
printer = self.printer
self.entPMakeModel.set_text(printer.make_and_model)
- state = self.printer_states.get (printer.state, _("Unknown"))
+ state = self.printer_states.get (printer.state,
+ _("Unknown").decode ('utf-8'))
reason = printer.other_attributes.get ('printer-state-message', '')
if len (reason) > 0:
state += ' - ' + reason

View File

@ -1,12 +0,0 @@
diff -up system-config-printer-1.4.1/asyncpk1.py.utf8-965771 system-config-printer-1.4.1/asyncpk1.py
--- system-config-printer-1.4.1/asyncpk1.py.utf8-965771 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/asyncpk1.py 2013-05-22 09:01:14.216632448 +0100
@@ -439,7 +439,7 @@ class PK1Connection:
result_str = dict()
for key, value in dbusdict.iteritems ():
if type (key) == dbus.String:
- result_str[str (key)] = str (value)
+ result_str[unicode (key)] = unicode (value)
else:
result_str[key] = value

View File

@ -1,15 +0,0 @@
diff -up system-config-printer-1.4.1/PhysicalDevice.py.utf8-968142 system-config-printer-1.4.1/PhysicalDevice.py
--- system-config-printer-1.4.1/PhysicalDevice.py.utf8-968142 2013-02-19 16:18:35.000000000 +0000
+++ system-config-printer-1.4.1/PhysicalDevice.py 2013-06-07 12:44:55.756548280 +0100
@@ -75,6 +75,11 @@ class PhysicalDevice:
if hostport:
(host, port) = urllib.splitport (hostport)
+
+ if type (host) == unicode:
+ host = host.encode ('utf-8')
+ if type (dnssdhost) == unicode:
+ dnssdhost = dnssdhost.encode ('utf-8')
return host, dnssdhost
def add_device (self, device):

View File

@ -1,41 +0,0 @@
diff -up system-config-printer-1.4.1/newprinter.py.utf8-969846 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-969846 2013-06-06 17:07:44.113770877 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-06-06 17:08:30.764007511 +0100
@@ -3377,7 +3377,7 @@ class NewPrinterGUI(GtkGUI):
recommended = (auto_make_norm and
cupshelpers.ppds.normalize (make) == auto_make_norm)
if self.device and self.device.make_and_model and recommended:
- text = make + _(" (recommended)")
+ text = make + _(" (recommended)").decode ('utf-8')
else:
text = make
@@ -3440,7 +3440,7 @@ class NewPrinterGUI(GtkGUI):
cupshelpers.ppds.normalize (pmodel) ==
auto_model_norm)
if self.device and self.device.make_and_model and recommended:
- text = pmodel + _(" (recommended)")
+ text = pmodel + _(" (recommended)").decode ('utf-8')
else:
text = pmodel
@@ -3528,7 +3528,8 @@ class NewPrinterGUI(GtkGUI):
driverlist.append (driver)
NPDrivers.append (ppdname)
i += 1
- iter = model.append ((driver + _(" (Current)"),))
+ iter = model.append ((driver +
+ _(" (Current)").decode ('utf-8'),))
path = model.get_path (iter)
self.tvNPDrivers.get_selection().select_path(path)
self.tvNPDrivers.scroll_to_cell(path, None, True, 0.5, 0.0)
@@ -3536,7 +3537,8 @@ class NewPrinterGUI(GtkGUI):
driverlist.append (driver)
NPDrivers.append (ppdname)
i += 1
- iter = model.append ((driver + _(" (recommended)"),))
+ iter = model.append ((driver +
+ _(" (recommended)").decode ('utf-8'),))
path = model.get_path (iter)
self.tvNPDrivers.get_selection().select_path(path)
self.tvNPDrivers.scroll_to_cell(path, None, True, 0.5, 0.0)

View File

@ -1,65 +0,0 @@
diff -up system-config-printer-1.4.1/newprinter.py.utf8-971417 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-971417 2013-06-06 17:11:08.781804207 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-06-06 17:11:46.179991962 +0100
@@ -1632,7 +1632,7 @@ class NewPrinterGUI(GtkGUI):
def on_entNPName_changed(self, widget):
# restrict
- text = unicode (widget.get_text(), locale.getpreferredencoding ())
+ text = unicode (widget.get_text(), 'utf-8')
new_text = text
new_text = new_text.replace("/", "")
new_text = new_text.replace("#", "")
@@ -2513,10 +2513,10 @@ class NewPrinterGUI(GtkGUI):
def entry_changed(self, entry, allowed_chars):
"Remove all chars from entry's text that are not in allowed_chars."
try:
- allowed_chars = unicode (allowed_chars, locale.getpreferredencoding())
+ allowed_chars = unicode (allowed_chars, 'utf-8')
except UnicodeDecodeError:
allowed_chars = unicode (allowed_chars)
- origtext = unicode (entry.get_text(), locale.getpreferredencoding ())
+ origtext = unicode (entry.get_text(), 'utf-8')
new_text = origtext
for char in origtext:
if char not in allowed_chars:
@@ -3883,10 +3883,9 @@ class NewPrinterGUI(GtkGUI):
self.dec_spinner_task ()
if self.dialog_mode in ("class", "printer", "printer_with_uri"):
- enc = locale.getpreferredencoding ()
- name = unicode (self.entNPName.get_text(), enc)
- location = unicode (self.entNPLocation.get_text(), enc)
- info = unicode (self.entNPDescription.get_text(), enc)
+ name = unicode (self.entNPName.get_text(), 'utf-8')
+ location = unicode (self.entNPLocation.get_text(), 'utf-8')
+ info = unicode (self.entNPDescription.get_text(), 'utf-8')
else:
name = self._name
diff -up system-config-printer-1.4.1/printerproperties.py.utf8-971417 system-config-printer-1.4.1/printerproperties.py
--- system-config-printer-1.4.1/printerproperties.py.utf8-971417 2013-06-06 17:11:08.776804182 +0100
+++ system-config-printer-1.4.1/printerproperties.py 2013-06-06 17:11:46.179991962 +0100
@@ -688,7 +688,7 @@ class PrinterPropertiesDialog(GtkGUI):
old_value = old_values[widget]
if type (old_value) == unicode:
- old_value = old_value.encode (locale.getpreferredencoding ())
+ old_value = old_value.encode ('utf-8')
if old_value == value:
self.changed.discard(widget)
@@ -1041,10 +1041,9 @@ class PrinterPropertiesDialog(GtkGUI):
for member in old_members:
self.cups.deletePrinterFromClass(member, name)
- enc = locale.getpreferredencoding ()
- location = self.entPLocation.get_text().decode (enc)
- info = self.entPDescription.get_text().decode (enc)
- device_uri = self.entPDevice.get_text().decode (enc)
+ location = self.entPLocation.get_text().decode ('utf-8')
+ info = self.entPDescription.get_text().decode ('utf-8')
+ device_uri = self.entPDevice.get_text().decode ('utf-8')
enabled = self.chkPEnabled.get_active()
accepting = self.chkPAccepting.get_active()

View File

@ -1,384 +0,0 @@
diff -up system-config-printer-1.4.1/asyncipp.py.utf8-971548 system-config-printer-1.4.1/asyncipp.py
--- system-config-printer-1.4.1/asyncipp.py.utf8-971548 2013-06-07 11:13:02.040050636 +0100
+++ system-config-printer-1.4.1/asyncipp.py 2013-06-07 11:13:19.561149594 +0100
@@ -575,7 +575,7 @@ class _IPPAuthOperation:
d.set_default_response (Gtk.ResponseType.OK)
d.connect ("response", self._on_retry_server_error_response)
debugprint ("%s (_reconnect_error): presenting error dialog (%s; %s)" %
- (self, msg, message))
+ (self, repr (msg), repr (message)))
d.show ()
def _on_retry_server_error_response (self, dialog, response):
@@ -688,11 +688,11 @@ if __name__ == "__main__":
error_handler=self.connect_failed)
def connected (self, conn, result):
- debugprint ("Success: %s" % result)
+ debugprint ("Success: %s" % repr (result))
self.get_devices_button.set_sensitive (True)
def connect_failed (self, conn, exc):
- debugprint ("Exc %s" % exc)
+ debugprint ("Exc %s" % repr (exc))
self.get_devices_button.set_sensitive (False)
self.conn.destroy ()
@@ -707,7 +707,7 @@ if __name__ == "__main__":
debugprint ("Ignoring stale reply")
return
- debugprint ("Got devices: %s" % result)
+ debugprint ("Got devices: %s" % repr (result))
self.get_devices_button.set_sensitive (True)
def get_devices_error (self, conn, exc):
@@ -715,7 +715,7 @@ if __name__ == "__main__":
debugprint ("Ignoring stale error")
return
- debugprint ("Error getting devices: %s" % exc)
+ debugprint ("Error getting devices: %s" % repr (exc))
self.get_devices_button.set_sensitive (True)
UI ()
diff -up system-config-printer-1.4.1/asyncpk1.py.utf8-971548 system-config-printer-1.4.1/asyncpk1.py
--- system-config-printer-1.4.1/asyncpk1.py.utf8-971548 2013-06-07 11:13:02.034050602 +0100
+++ system-config-printer-1.4.1/asyncpk1.py 2013-06-07 11:13:19.562149604 +0100
@@ -84,7 +84,7 @@ class _PK1AsyncMethodCall:
error_handler=self._pk_error_handler,
timeout=3600)
except TypeError, e:
- debugprint ("Type error in PK call: %s" % e)
+ debugprint ("Type error in PK call: %s" % repr (e))
self.call_fallback_fn ()
def _destroy (self):
@@ -120,7 +120,7 @@ class _PK1AsyncMethodCall:
self._destroy ()
return
- debugprint ("PolicyKit method failed with: %s" % repr (str (error)))
+ debugprint ("PolicyKit method failed with: %s" % repr (error))
self.call_fallback_fn ()
def _pk_error_handler (self, exc):
@@ -144,7 +144,7 @@ class _PK1AsyncMethodCall:
return
debugprint ("PolicyKit call to %s did not work: %s" %
- (self._pk_method_name, exc))
+ (self._pk_method_name, repr (exc)))
self.call_fallback_fn ()
def call_fallback_fn (self):
@@ -270,7 +270,7 @@ class PK1Connection:
break
except Exception, e:
- debugprint ("Exception assessing DevicesGet API: %s" % e)
+ debugprint ("Exception assessing DevicesGet API: %s" % repr (e))
methodtype = type (self._conn.getPrinters)
bindings = []
diff -up system-config-printer-1.4.1/authconn.py.utf8-971548 system-config-printer-1.4.1/authconn.py
--- system-config-printer-1.4.1/authconn.py.utf8-971548 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/authconn.py 2013-06-07 11:13:19.562149604 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/python
-## Copyright (C) 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
+## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013 Red Hat, Inc.
## Author: Tim Waugh <twaugh@redhat.com>
## This program is free software; you can redistribute it and/or modify
@@ -271,7 +271,7 @@ class Connection:
if self._cancel and not self._cannot_auth:
raise cups.IPPError (0, _("Operation canceled"))
- debugprint ("%s: %s" % (e, m))
+ debugprint ("%s: %s" % (e, repr (m)))
raise
except cups.HTTPError, (s,):
if not self._cancel:
diff -up system-config-printer-1.4.1/cupshelpers/cupshelpers.py.utf8-971548 system-config-printer-1.4.1/cupshelpers/cupshelpers.py
--- system-config-printer-1.4.1/cupshelpers/cupshelpers.py.utf8-971548 2013-06-07 11:13:02.025050551 +0100
+++ system-config-printer-1.4.1/cupshelpers/cupshelpers.py 2013-06-07 11:13:19.562149604 +0100
@@ -701,7 +701,8 @@ def copyPPDOptions(ppd1, ppd2):
for choice in new_option.choices:
if choice["choice"]==value:
ppd2.markOption(new_option.keyword, value)
- _debugprint ("set %s = %s" % (new_option.keyword, value))
+ _debugprint ("set %s = %s" % (repr (new_option.keyword),
+ repr (value)))
def setPPDPageSize(ppd, language):
"""
@@ -722,9 +723,9 @@ def setPPDPageSize(ppd, language):
size = 'Letter'
try:
ppd.markOption ('PageSize', size)
- _debugprint ("set PageSize = %s" % size)
+ _debugprint ("set PageSize = %s" % repr (size))
except:
- _debugprint ("Failed to set PageSize (%s not available?)" % size)
+ _debugprint ("Failed to set PageSize (%s not available?)" % repr (size))
def missingExecutables(ppd):
"""
@@ -750,10 +751,10 @@ def missingExecutables(ppd):
return "true"
if name[0] == '/':
if os.access (name, os.X_OK):
- _debugprint ("%s: found" % name)
+ _debugprint ("%s: found" % repr (name))
return name
else:
- _debugprint ("%s: NOT found" % name)
+ _debugprint ("%s: NOT found" % repr (name))
return None
if name.find ("=") != -1:
return "builtin"
@@ -768,9 +769,9 @@ def missingExecutables(ppd):
for component in path.split (':'):
file = component.rstrip (os.path.sep) + os.path.sep + name
if os.access (file, os.X_OK):
- _debugprint ("%s: found" % file)
+ _debugprint ("%s: found" % repr (file))
return file
- _debugprint ("%s: NOT found in %s" % (name,path))
+ _debugprint ("%s: NOT found in %s" % (repr (name), repr (path)))
return None
exes_to_install = []
diff -up system-config-printer-1.4.1/cupspk.py.utf8-971548 system-config-printer-1.4.1/cupspk.py
--- system-config-printer-1.4.1/cupspk.py.utf8-971548 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/cupspk.py 2013-06-07 11:13:19.562149604 +0100
@@ -1,6 +1,6 @@
# vim: set ts=4 sw=4 et: coding=UTF-8
#
-# Copyright (C) 2008 Novell, Inc.
+# Copyright (C) 2008, 2013 Novell, Inc.
# Copyright (C) 2008, 2009, 2010, 2012 Red Hat, Inc.
# Copyright (C) 2008, 2009, 2010, 2012 Tim Waugh <twaugh@redhat.com>
#
@@ -141,7 +141,7 @@ class Connection:
# exception that wasn't handled, or an error in the mechanism itself)
if pk_retval != '':
debugprint ('PolicyKit call to %s did not work: %s' %
- (pk_function_name, pk_retval))
+ (pk_function_name, repr (pk_retval)))
return fallback_function(*args, **kwds)
diff -up system-config-printer-1.4.1/dnssdresolve.py.utf8-971548 system-config-printer-1.4.1/dnssdresolve.py
--- system-config-printer-1.4.1/dnssdresolve.py.utf8-971548 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/dnssdresolve.py 2013-06-07 11:13:19.563149612 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/python
-## Copyright (C) 2010, 2011, 2012 Red Hat, Inc.
+## Copyright (C) 2010, 2011, 2012, 2013 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
@@ -75,7 +75,7 @@ class DNSSDHostNamesResolver:
server = dbus.Interface (obj,
"org.freedesktop.Avahi.Server")
self._device_uri_by_name[(name, stype, domain)] = uri
- debugprint ("Resolving address for %s" % hostname)
+ debugprint ("Resolving address for %s" % repr (hostname))
server.ResolveService (-1, -1,
name, stype, domain,
-1, 0,
@@ -83,7 +83,7 @@ class DNSSDHostNamesResolver:
error_handler=lambda e:
self._error (uri, e))
except dbus.DBusException, e:
- debugprint ("Failed to resolve address: %s" % e)
+ debugprint ("Failed to resolve address: %s" % repr (e))
self._resolved ()
def _resolved (self):
@@ -107,7 +107,7 @@ class DNSSDHostNamesResolver:
self._resolved ()
def _error (self, uri, error):
- debugprint ("Error resolving %s: %s" % (uri, error))
+ debugprint ("Error resolving %s: %s" % (uri, repr (error)))
self._resolved ()
if __name__ == '__main__':
diff -up system-config-printer-1.4.1/jobviewer.py.utf8-971548 system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.utf8-971548 2013-06-07 11:13:02.041050641 +0100
+++ system-config-printer-1.4.1/jobviewer.py 2013-06-07 11:13:19.563149612 +0100
@@ -957,7 +957,8 @@ class JobViewer (GtkGUI):
ind = auth_info_required.index ('password')
auth_info[ind] = items[0].secret
else:
- debugprint ("gnomekeyring: look-up result %s" % result)
+ debugprint ("gnomekeyring: look-up result %s" %
+ repr (result))
if try_keyring and c == None:
try:
@@ -1092,7 +1093,8 @@ class JobViewer (GtkGUI):
val)
id = gnomekeyring.item_create_sync (keyring, type, name,
attrs, secret, True)
- debugprint ("keyring: created id %d for %s" % (id, name))
+ debugprint ("keyring: created id %d for %s" % (repr (id),
+ repr (name)))
except:
nonfatalException ()
@@ -1833,7 +1835,8 @@ class JobViewer (GtkGUI):
for attr, value in jobdata.iteritems ():
if not self.jobs[jobid].has_key (attr):
self.jobs[jobid][attr] = value
- debugprint ("Add %s=%s (my job)" % (attr, value))
+ debugprint ("Add %s=%s (my job)" % (repr (attr),
+ repr (value)))
# If we failed to get required attributes for the job, bail.
if not self.jobiters.has_key (jobid):
diff -up system-config-printer-1.4.1/newprinter.py.utf8-971548 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-971548 2013-06-07 11:13:02.038050624 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-06-07 11:13:19.564149619 +0100
@@ -186,7 +186,7 @@ def download_gpg_fingerprint(url):
try:
c.perform()
except pycurl.error as e:
- debugprint('Cannot retrieve %s: %s' % (url, str(e)))
+ debugprint('Cannot retrieve %s: %s' % (url, repr (e)))
return None
keyid_re = re.compile(' ((?:(?:[0-9A-F]{4})(?:\s+|$)){2})$', re.M)
@@ -898,7 +898,7 @@ class NewPrinterGUI(GtkGUI):
debugprint('No packages for driver')
return False
if len(arches) > 1:
- debugprint('Returned more than one matching architecture, please report this as a bug: %s', str(arches))
+ debugprint('Returned more than one matching architecture, please report this as a bug: %s', repr (arches))
return False
pkgs = pkgs[arches[0]]
@@ -933,14 +933,18 @@ class NewPrinterGUI(GtkGUI):
repo = pkgs[pkg].get('repositories', {}).get(self.packageinstaller)
if not repo:
- debugprint('Local package system %s not found in %s',
- self.packageinstaller, pkgs[pkg].get('repositories', {}))
+ debugprint('Local package system %s not found in %s' %
+ (self.packageinstaller,
+ repr (pkgs[pkg].get('repositories', {}))))
return False
if onlycheckpresence:
return True
- debugprint('Installing driver: "%s"; Repo: "%s"; Key ID: "%s"' % (name, repo, keyid))
+ debugprint('Installing driver: %s; Repo: %s; Key ID: %s' %
+ (repr (name),
+ repr (repo),
+ repr (keyid)))
fmt = _("Installing driver %s" % name)
self._installdialog = Gtk.MessageDialog (parent=self.NewPrinterWindow,
@@ -2521,7 +2525,7 @@ class NewPrinterGUI(GtkGUI):
for char in origtext:
if char not in allowed_chars:
new_text = new_text.replace(char, "")
- debugprint ("removed disallowed character %s" % char)
+ debugprint ("removed disallowed character %s" % repr (char))
if origtext!=new_text:
entry.set_text(new_text)
@@ -2958,7 +2962,7 @@ class NewPrinterGUI(GtkGUI):
if text.find (":") != -1:
# The user is typing in a URI. In that case, switch to URI entry.
ent.set_text ('')
- debugprint ("URI detected (%s) -> Enter URI" % text)
+ debugprint ("URI detected (%s) -> Enter URI" % repr (text))
self.entNPTDevice.set_text (text)
model = self.tvNPDevices.get_model ()
path = model.get_path (self.devices_uri_iter)
@@ -3146,7 +3150,7 @@ class NewPrinterGUI(GtkGUI):
label = self.btnNPDownloadableDriverSearch_label
label.set_text (_("Searching"))
searchterm = self.entNPDownloadableDriverSearch.get_text ()
- debugprint ('Searching for "%s"' % searchterm)
+ debugprint ('Searching for "%s"' % repr (searchterm))
self.drivers_lock.acquire ()
self.openprinting_query_handle = \
self.openprinting.searchPrinters (searchterm,
@@ -3742,7 +3746,7 @@ class NewPrinterGUI(GtkGUI):
os.unlink(ppdname)
except RuntimeError, e:
- debugprint ("RuntimeError: " + str(e))
+ debugprint ("RuntimeError: " + repr (e))
if self.rbtnNPFoomatic.get_active():
# Foomatic database problem of some sort.
err_title = _('Database error')
diff -up system-config-printer-1.4.1/ppdcache.py.utf8-971548 system-config-printer-1.4.1/ppdcache.py
--- system-config-printer-1.4.1/ppdcache.py.utf8-971548 2013-05-09 12:10:44.000000000 +0100
+++ system-config-printer-1.4.1/ppdcache.py 2013-06-07 11:13:19.564149619 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/python
-## Copyright (C) 2010, 2011, 2012 Red Hat, Inc.
+## Copyright (C) 2010, 2011, 2012, 2013 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
@@ -73,7 +73,7 @@ class PPDCache:
return
- debugprint ("%s: fetch PPD for %s" % (self, name))
+ debugprint ("%s: fetch PPD for %s" % (self, repr (name)))
self._cups.getPPD3 (name,
reply_handler=lambda c, r:
self._got_ppd3 (c, name, r, callback),
@@ -188,8 +188,8 @@ if __name__ == "__main__":
def signal (name, result, exc):
debugprint ("**** %s" % name)
- debugprint (result)
- debugprint (exc)
+ debugprint (repr (result))
+ debugprint (repr (exc))
c = cups.Connection ()
printers = c.getPrinters ()
diff -up system-config-printer-1.4.1/ppdsloader.py.utf8-971548 system-config-printer-1.4.1/ppdsloader.py
--- system-config-printer-1.4.1/ppdsloader.py.utf8-971548 2013-05-09 12:10:44.000000000 +0100
+++ system-config-printer-1.4.1/ppdsloader.py 2013-06-07 11:13:19.564149619 +0100
@@ -222,7 +222,7 @@ class PPDsLoader(GObject.GObject):
error_handler=self._packagekit_error,
timeout=3600)
except Exception, e:
- debugprint ("Failed to talk to PackageKit: %s" % e)
+ debugprint ("Failed to talk to PackageKit: %s" % repr (e))
if self._dialog:
self._dialog.show_all ()
self._query_cups ()
@@ -235,7 +235,7 @@ class PPDsLoader(GObject.GObject):
self._query_cups ()
def _packagekit_error (self, exc):
- debugprint ("Got PackageKit error: %s" % exc)
+ debugprint ("Got PackageKit error: %s" % repr (exc))
if self._dialog:
self._dialog.show_all ()
self._query_cups ()
@@ -262,7 +262,7 @@ class PPDsLoader(GObject.GObject):
self._query_cups ()
def _jockey_error (self, exc):
- debugprint ("Got Jockey error: %s" % exc)
+ debugprint ("Got Jockey error: %s" % repr (exc))
if self._need_requery_cups:
self._query_cups ()
else:

View File

@ -1,540 +0,0 @@
diff -up system-config-printer-1.4.1/applet.py.utf8-971973 system-config-printer-1.4.1/applet.py
--- system-config-printer-1.4.1/applet.py.utf8-971973 2013-07-02 09:36:22.064027939 +0100
+++ system-config-printer-1.4.1/applet.py 2013-07-02 09:36:31.200068904 +0100
@@ -117,7 +117,7 @@ class NewPrinterNotification(dbus.servic
device = "%s %s" % (mfg, mdl)
else:
device = des
- text = _("No printer driver for %s.") % device
+ text = _("No printer driver for %s.").decode ('utf-8') % device
else:
text = _("No driver for this printer.")
n = Notify.Notification.new (title, text, 'printer')
@@ -202,7 +202,7 @@ class NewPrinterNotification(dbus.servic
lambda x, y: self.configure (x, y, name))
else: # Model mismatch
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
- text = (_("`%s' has been added, using the `%s' driver.") %
+ text = (_("`%s' has been added, using the `%s' driver.").decode ('utf-8') %
(name, driver))
n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
diff -up system-config-printer-1.4.1/asyncipp.py.utf8-971973 system-config-printer-1.4.1/asyncipp.py
--- system-config-printer-1.4.1/asyncipp.py.utf8-971973 2013-07-02 09:36:22.056027904 +0100
+++ system-config-printer-1.4.1/asyncipp.py 2013-07-02 09:36:31.200068904 +0100
@@ -474,7 +474,7 @@ class _IPPAuthOperation:
if op == None:
d = authconn.AuthDialog (parent=conn.parent)
else:
- title = _("Authentication (%s)") % op
+ title = _("Authentication (%s)").decode ('utf-8') % op
d = authconn.AuthDialog (title=title,
parent=conn.parent)
@@ -551,7 +551,7 @@ class _IPPAuthOperation:
if op == None:
msg = _("CUPS server error")
else:
- msg = _("CUPS server error (%s)") % op
+ msg = _("CUPS server error (%s)").decode ('utf-8') % op
d = Gtk.MessageDialog (self._conn.parent,
Gtk.DialogFlags.MODAL |
diff -up system-config-printer-1.4.1/authconn.py.utf8-971973 system-config-printer-1.4.1/authconn.py
--- system-config-printer-1.4.1/authconn.py.utf8-971973 2013-07-02 09:36:22.051027881 +0100
+++ system-config-printer-1.4.1/authconn.py 2013-07-02 09:36:31.200068904 +0100
@@ -286,7 +286,8 @@ class Connection:
Gdk.threads_enter ()
try:
- msg = _("CUPS server error (%s)") % self._operation_stack[0]
+ msg = (_("CUPS server error (%s)").decode ('utf-8') %
+ self._operation_stack[0])
except IndexError:
msg = _("CUPS server error")
@@ -461,7 +462,8 @@ class Connection:
# Prompt.
if len (self._operation_stack) > 0:
try:
- title = _("Authentication (%s)") % self._operation_stack[0]
+ title = (_("Authentication (%s)").decode ('utf-8') %
+ self._operation_stack[0])
except IndexError:
title = _("Authentication")
diff -up system-config-printer-1.4.1/errordialogs.py.utf8-971973 system-config-printer-1.4.1/errordialogs.py
--- system-config-printer-1.4.1/errordialogs.py.utf8-971973 2013-05-09 12:10:43.000000000 +0100
+++ system-config-printer-1.4.1/errordialogs.py 2013-07-02 09:36:31.201068906 +0100
@@ -2,7 +2,7 @@
## system-config-printer
-## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc.
+## Copyright (C) 2006, 2007, 2008, 2010, 2013 Red Hat, Inc.
## Authors:
## Florian Festi <ffesti@redhat.com>
## Tim Waugh <twaugh@redhat.com>
@@ -52,7 +52,7 @@ def show_IPP_Error(exception, message, p
else:
title = _("CUPS server error")
text = (_("There was an error during the CUPS "
- "operation: '%s'.")) % message
+ "operation: '%s'.").decode ('utf-8')) % message
show_error_dialog (title, text, parent)
@@ -78,8 +78,8 @@ def show_HTTP_Error(status, parent=None)
elif status == -1:
msg = _("Not connected")
else:
- msg = _("status %s") % status
+ msg = _("status %s").decode ('utf-8') % status
- text = _("There was an HTTP error: %s.") % msg
+ text = _("There was an HTTP error: %s.").decode ('utf-8') % msg
show_error_dialog (title, text, parent)
diff -up system-config-printer-1.4.1/jobviewer.py.utf8-971973 system-config-printer-1.4.1/jobviewer.py
--- system-config-printer-1.4.1/jobviewer.py.utf8-971973 2013-07-02 09:36:22.064027939 +0100
+++ system-config-printer-1.4.1/jobviewer.py 2013-07-02 09:36:31.201068906 +0100
@@ -267,7 +267,7 @@ class CancelJobsOperation(GObject.GObjec
else:
operation = _("canceling job")
- self.connection._begin_operation (operation)
+ self.connection._begin_operation (operation.decode ('utf-8'))
self.connection.cancelJob (self.jobids[0], self.purge_job,
reply_handler=self.cancelJob_finish,
error_handler=self.cancelJob_error)
@@ -502,7 +502,7 @@ class JobViewer (GtkGUI):
title = _("my jobs")
else:
if specific_dests:
- title = "%s" % the_dests
+ title = "%s" % the_dests.encode ('utf-8')
else:
title = _("all jobs")
self.JobsWindow.set_title (_("Document Print Status (%s)") % title)
@@ -971,7 +971,7 @@ class JobViewer (GtkGUI):
if try_keyring and auth_info != None:
try:
- c._begin_operation (_("authenticating job"))
+ c._begin_operation (_("authenticating job").decode ('utf-8'))
c.authenticateJob (job, auth_info)
c._end_operation ()
self.update_monitor ()
@@ -1053,7 +1053,7 @@ class JobViewer (GtkGUI):
return
remember = False
- c._begin_operation (_("authenticating job"))
+ c._begin_operation (_("authenticating job").decode ('utf-8'))
try:
c.authenticateJob (jobid, auth_info)
remember = dialog.get_remember_password ()
@@ -1313,7 +1313,7 @@ class JobViewer (GtkGUI):
return
for jobid in self.jobids:
- c._begin_operation (_("holding job"))
+ c._begin_operation (_("holding job").decode ('utf-8'))
try:
c.setJobHoldUntil (jobid, "indefinite")
except cups.IPPError, (e, m):
@@ -1338,7 +1338,7 @@ class JobViewer (GtkGUI):
return
for jobid in self.jobids:
- c._begin_operation (_("releasing job"))
+ c._begin_operation (_("releasing job").decode ('utf-8'))
try:
c.setJobHoldUntil (jobid, "no-hold")
except cups.IPPError, (e, m):
@@ -2246,7 +2246,8 @@ class JobViewer (GtkGUI):
os.environ["TZ"] = old_tz
local = time.localtime (simpletime)
- state = _("Held until %s") % time.strftime ("%X", local)
+ state = (_("Held until %s") %
+ time.strftime ("%X", local).encode ('utf-8'))
except ValueError:
pass
if until == "day-time":
diff -up system-config-printer-1.4.1/newprinter.py.utf8-971973 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-971973 2013-07-02 09:36:22.061027926 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-07-02 09:36:31.202068908 +0100
@@ -716,8 +716,7 @@ class NewPrinterGUI(GtkGUI):
if scheme in ["socket", "lpd", "ipp"]:
schemes.extend (["snmp", "dnssd"])
self.fetchDevices_conn = asyncconn.Connection ()
- self.fetchDevices_conn._begin_operation (_("fetching device "
- "list"))
+ self.fetchDevices_conn._begin_operation (_("fetching device list").decode ('utf-8'))
self.inc_spinner_task ()
cupshelpers.getDevices (self.fetchDevices_conn,
include_schemes=schemes,
@@ -946,7 +945,7 @@ class NewPrinterGUI(GtkGUI):
repr (repo),
repr (keyid)))
- fmt = _("Installing driver %s" % name)
+ fmt = _("Installing driver %s").decode ('utf-8') % name
self._installdialog = Gtk.MessageDialog (parent=self.NewPrinterWindow,
flags=Gtk.DialogFlags.MODAL |
Gtk.DialogFlags.DESTROY_WITH_PARENT,
@@ -1986,7 +1985,7 @@ class NewPrinterGUI(GtkGUI):
def start_fetching_devices (self):
self.fetchDevices_conn = asyncconn.Connection ()
- self.fetchDevices_conn._begin_operation (_("fetching device list"))
+ self.fetchDevices_conn._begin_operation (_("fetching device list").decode ('utf-8'))
self.fetchDevices (network=False, current_uri=self.current_uri)
del self.current_uri
@@ -2625,7 +2624,8 @@ class NewPrinterGUI(GtkGUI):
if queue[0] == '/':
queue = queue[1:]
- device.menuentry = _("LPD/LPR queue '%s'") % queue
+ device.menuentry = (_("LPD/LPR queue '%s'").decode ('utf-8')
+ % queue)
else:
device.menuentry = _("LPD/LPR queue")
@@ -2641,7 +2641,8 @@ class NewPrinterGUI(GtkGUI):
if queue.startswith("printers/"):
queue = queue[9:]
if queue != '':
- device.menuentry = _("IPP") + " (%s)" % queue
+ device.menuentry = (_("IPP").decode ('utf-8') +
+ " (%s)" % queue)
else:
device.menuentry = _("IPP")
elif device.type == "http" or device.type == "https":
@@ -2665,8 +2666,8 @@ class NewPrinterGUI(GtkGUI):
elif name.find("._pdl-datastream") != -1:
protocol = "AppSocket/JetDirect"
if protocol != None:
- device.menuentry = \
- _("%s network printer via DNS-SD") % protocol
+ device.menuentry = (_("%s network printer via DNS-SD").decode ('utf-8')
+ % protocol)
else:
device.menuentry = \
_("Network printer via DNS-SD")
@@ -3751,7 +3752,7 @@ class NewPrinterGUI(GtkGUI):
# Foomatic database problem of some sort.
err_title = _('Database error')
err_text = _("The '%s' driver cannot be "
- "used with printer '%s %s'.")
+ "used with printer '%s %s'.").decode ('utf-8')
model, iter = (self.tvNPDrivers.get_selection().
get_selected())
nr = model.get_path(iter)[0]
@@ -3761,7 +3762,7 @@ class NewPrinterGUI(GtkGUI):
# installed by default. Point the user at the
# package they need to install.
err = _("You will need to install the '%s' package "
- "in order to use this driver.") % \
+ "in order to use this driver.").decode ('utf-8') % \
"gutenprint-foomatic"
else:
err = err_text % (driver, self.NPMake, self.NPModel)
@@ -3796,7 +3797,7 @@ class NewPrinterGUI(GtkGUI):
debugprint("ppd: " + repr(ppd))
if isinstance(ppd, str) or isinstance(ppd, unicode):
- self.cups._begin_operation (_("fetching PPD"))
+ self.cups._begin_operation (_("fetching PPD").decode ('utf-8'))
try:
if ppd != "raw":
f = self.cups.getServerPPD(ppd)
@@ -3929,8 +3930,8 @@ class NewPrinterGUI(GtkGUI):
busy (self.NewPrinterWindow)
while Gtk.events_pending ():
Gtk.main_iteration ()
- self.cups._begin_operation (_("adding printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("adding printer %s").decode ('utf-8')
+ % name)
try:
if isinstance(ppd, str) or isinstance(ppd, unicode):
self.cups.addPrinter(name, ppdname=ppd,
@@ -3957,8 +3958,8 @@ class NewPrinterGUI(GtkGUI):
self.cups._end_operation()
ready (self.NewPrinterWindow)
if self.dialog_mode in ("class", "printer", "printer_with_uri"):
- self.cups._begin_operation (_("modifying printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % name)
try:
cupshelpers.activateNewPrinter (self.cups, name)
self.cups.setPrinterLocation(name, location)
@@ -3969,8 +3970,8 @@ class NewPrinterGUI(GtkGUI):
return
self.cups._end_operation ()
elif self.dialog_mode == "device":
- self.cups._begin_operation (_("modifying printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % name)
try:
uri = self.getDeviceURI()
self.cups.addPrinter(name, device=uri)
@@ -3987,8 +3988,8 @@ class NewPrinterGUI(GtkGUI):
self.nextNPTab(-1)
return
- self.cups._begin_operation (_("modifying printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % name)
# set ppd on server and retrieve it
# cups doesn't offer a way to just download a ppd ;(=
raw = False
diff -up system-config-printer-1.4.1/ppdsloader.py.utf8-971973 system-config-printer-1.4.1/ppdsloader.py
--- system-config-printer-1.4.1/ppdsloader.py.utf8-971973 2013-07-02 09:36:22.053027890 +0100
+++ system-config-printer-1.4.1/ppdsloader.py 2013-07-02 09:36:31.203068915 +0100
@@ -151,7 +151,7 @@ class PPDsLoader(GObject.GObject):
self._cups_connect_reply(self._conn, None)
def _cups_connect_reply (self, conn, UNUSED):
- conn._begin_operation (_("fetching PPDs"))
+ conn._begin_operation (_("fetching PPDs").decode ('utf-8'))
conn.getPPDs2 (reply_handler=self._cups_reply,
error_handler=self._cups_error)
diff -up system-config-printer-1.4.1/printerproperties.py.utf8-971973 system-config-printer-1.4.1/printerproperties.py
--- system-config-printer-1.4.1/printerproperties.py.utf8-971973 2013-07-02 09:36:22.049027872 +0100
+++ system-config-printer-1.4.1/printerproperties.py 2013-07-02 09:36:31.203068915 +0100
@@ -1000,11 +1000,11 @@ class PrinterPropertiesDialog(GtkGUI):
name = printer.name
if printer.is_class:
- self.cups._begin_operation (_("modifying class %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying class %s").decode ('utf-8')
+ % name)
else:
- self.cups._begin_operation (_("modifying printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % name)
try:
if not printer.is_class and self.ppd:
@@ -1112,7 +1112,7 @@ class PrinterPropertiesDialog(GtkGUI):
# but we have never fetched the server settings to see whether
# the server is publishing shared printers. Fetch the settings
# now so that we can update the "not published" label if necessary.
- self.cups._begin_operation (_("fetching server settings"))
+ self.cups._begin_operation (_("fetching server settings").decode ('utf-8'))
try:
self.server_settings = self.cups.adminGetServerSettings()
except:
@@ -1195,7 +1195,7 @@ class PrinterPropertiesDialog(GtkGUI):
return
job_id = None
- c._begin_operation (_("printing test page"))
+ c._begin_operation (_("printing test page").decode ('utf-8'))
try:
if custom_testpage and os.path.exists(custom_testpage):
debugprint ('Printing custom test page ' + custom_testpage)
@@ -1234,7 +1234,7 @@ class PrinterPropertiesDialog(GtkGUI):
(tmpfd, tmpfname) = tempfile.mkstemp ()
os.write (tmpfd, "#CUPS-COMMAND\n%s\n" % command)
os.close (tmpfd)
- self.cups._begin_operation (_("sending maintenance command"))
+ self.cups._begin_operation (_("sending maintenance command").decode ('utf-8'))
try:
format = "application/vnd.cups-command"
job_id = self.cups.printTestPage (printer.name,
@@ -1432,10 +1432,10 @@ class PrinterPropertiesDialog(GtkGUI):
nonfatalException()
option_editable = False
show_error_dialog (_("Error"),
- _("Option '%s' has value '%s' "
- "and cannot be edited.") %
- (option.name.encode ('utf-8'),
- value.encode ('utf-8')),
+ _("Option '%s' has value '%s' and "
+ "cannot be edited.").decode ('utf-8') %
+ (option.name,
+ value),
self.parent)
option.widget.set_sensitive (option_editable)
if not editable:
diff -up system-config-printer-1.4.1/pysmb.py.utf8-971973 system-config-printer-1.4.1/pysmb.py
--- system-config-printer-1.4.1/pysmb.py.utf8-971973 2013-07-02 09:36:22.059027917 +0100
+++ system-config-printer-1.4.1/pysmb.py 2013-07-02 09:36:31.203068915 +0100
@@ -109,7 +109,8 @@ class AuthContext:
hbox.pack_start (image, False, False, 0)
vbox = Gtk.VBox (False, 12)
label = Gtk.Label(label='<span weight="bold" size="larger">' +
- _("You must log in to access %s.") % self.for_server +
+ _("You must log in to access %s.").decode ('utf-8')
+ % self.for_server +
'</span>')
label.set_use_markup (True)
label.set_alignment (0, 0)
diff -up system-config-printer-1.4.1/serversettings.py.utf8-971973 system-config-printer-1.4.1/serversettings.py
--- system-config-printer-1.4.1/serversettings.py.utf8-971973 2013-05-09 12:10:45.000000000 +0100
+++ system-config-printer-1.4.1/serversettings.py 2013-07-02 09:36:31.204068921 +0100
@@ -2,7 +2,7 @@
## system-config-printer
-## Copyright (C) 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
@@ -194,7 +194,7 @@ class ServerSettings(GtkGUI):
def _fillBasic(self):
self.changed = set()
- self.cupsconn._begin_operation (_("fetching server settings"))
+ self.cupsconn._begin_operation (_("fetching server settings").decode ('utf-8'))
try:
self.server_settings = self.cupsconn.adminGetServerSettings()
except cups.IPPError, (e, m):
@@ -511,7 +511,7 @@ class ServerSettings(GtkGUI):
(self.chkServerLogDebug, cups.CUPS_SERVER_DEBUG_LOGGING),]:
if not self.server_settings.has_key(setting): continue
setting_dict[setting] = str(int(widget.get_active()))
- self.cupsconn._begin_operation (_("modifying server settings"))
+ self.cupsconn._begin_operation (_("modifying server settings").decode ('utf-8'))
try:
self.cupsconn.adminSetServerSettings(setting_dict)
except cups.IPPError, (e, m):
diff -up system-config-printer-1.4.1/system-config-printer.py.utf8-971973 system-config-printer-1.4.1/system-config-printer.py
--- system-config-printer-1.4.1/system-config-printer.py.utf8-971973 2013-07-02 09:36:22.062027931 +0100
+++ system-config-printer-1.4.1/system-config-printer.py 2013-07-02 09:36:31.204068921 +0100
@@ -664,10 +664,11 @@ class GUI(GtkGUI):
connected = bool(self.cups)
host = CUPS_server_hostname ()
- self.PrintersWindow.set_title(_("Print Settings - %s") % host)
+ self.PrintersWindow.set_title(_("Print Settings - %s")
+ .decode ('utf-8') % host)
if connected:
- status_msg = _("Connected to %s") % host
+ status_msg = _("Connected to %s").decode ('utf-8') % host
else:
status_msg = _("Not connected")
self.statusbarMain.push(self.status_context_id, status_msg)
@@ -718,7 +719,7 @@ class GUI(GtkGUI):
if self.cups:
kill_connection = False
self.cups._set_prompt_allowed (prompt_allowed)
- self.cups._begin_operation (_("obtaining queue details"))
+ self.cups._begin_operation (_("obtaining queue details").decode ('utf-8'))
try:
# get Printers
self.printers = cupshelpers.getPrinters(self.cups)
@@ -1028,8 +1029,8 @@ class GUI(GtkGUI):
servername = self.cmbServername.get_child().get_text()
- self.lblConnecting.set_markup(_("<i>Opening connection to %s</i>") %
- servername)
+ self.lblConnecting.set_markup(_("<i>Opening connection to %s</i>")
+ .decode ('utf-8') % servername)
self.ConnectingDialog.set_transient_for(self.PrintersWindow)
self.ConnectingDialog.show()
GLib.timeout_add (40, self.update_connecting_pbar)
@@ -1195,7 +1196,7 @@ class GUI(GtkGUI):
def set_default_printer (self, name):
printer = self.printers[name]
reload = False
- self.cups._begin_operation (_("setting default printer"))
+ self.cups._begin_operation (_("setting default printer").decode ('utf-8'))
try:
reload = printer.setAsDefault ()
except cups.HTTPError, (s,):
@@ -1370,7 +1371,7 @@ class GUI(GtkGUI):
if not self.is_rename_possible (old_name):
return
- self.cups._begin_operation (_("renaming printer"))
+ self.cups._begin_operation (_("renaming printer").decode ('utf-8'))
rejecting = self.propertiesDlg.printer.rejecting
if not rejecting:
try:
@@ -1523,11 +1524,11 @@ class GUI(GtkGUI):
obj = model.get_value (itr, 0)
name = model.get_value (itr, 2).decode ('utf-8')
if obj.is_class:
- message_format = (_("Really delete class '%s'?") %
- name.encode ('utf-8'))
+ message_format = (_("Really delete class '%s'?").decode ('utf-8')
+ % name)
else:
- message_format = (_("Really delete printer '%s'?") %
- name.encode ('utf-8'))
+ message_format = (_("Really delete printer '%s'?").decode ('utf-8')
+ % name)
to_delete.append (name)
else:
@@ -1554,8 +1555,8 @@ class GUI(GtkGUI):
try:
for name in to_delete:
- self.cups._begin_operation (_("deleting printer %s") %
- name.encode ('utf-8'))
+ self.cups._begin_operation (_("deleting printer %s").decode ('utf-8')
+ % name)
self.cups.deletePrinter (name)
self.cups._end_operation ()
except cups.IPPError, (e, msg):
@@ -1580,8 +1581,8 @@ class GUI(GtkGUI):
for printer in printers:
print repr (printer.name)
- self.cups._begin_operation (_("modifying printer %s") %
- printer.name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % printer.name)
try:
printer.setEnabled (enable)
except cups.IPPError, (e, m):
@@ -1610,8 +1611,8 @@ class GUI(GtkGUI):
success = False
for printer in printers:
- self.cups._begin_operation (_("modifying printer %s") %
- printer.name.encode ('utf-8'))
+ self.cups._begin_operation (_("modifying printer %s").decode ('utf-8')
+ % printer.name)
try:
printer.setShared (share)
success = True
@@ -1954,8 +1955,8 @@ class GUI(GtkGUI):
install_text = ('<span weight="bold" size="larger">' +
_('Install driver') + '</span>\n\n' +
_("Printer '%s' requires the %s package but "
- "it is not currently installed.") %
- (name.encode ('utf-8'), pkg))
+ "it is not currently installed.")
+ .decode ('utf-8') % (name, pkg))
dialog = self.InstallDialog
self.lblInstall.set_markup(install_text)
dialog.set_transient_for (parent)
@@ -1972,8 +1973,9 @@ class GUI(GtkGUI):
_("Printer '%s' requires the '%s' program "
"but it is not currently installed. "
"Please install it before using this "
- "printer.") % (name.encode ('utf-8'),
- (exes + pkgs)[0]),
+ "printer.").decode ('utf-8') %
+ (name,
+ (exes + pkgs)[0]),
parent)
def on_printer_modified (self, obj, name, ppd_has_changed):

View File

@ -1,33 +1,12 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.4.1
Release: 10%{?dist}
Version: 1.4.2
Release: 1%{?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.4/%{name}-%{version}.tar.xz
Patch1: system-config-printer-no-applet-in-gnome.patch
Patch2: system-config-printer-utf8-961882.patch
Patch3: system-config-printer-utf8-962207.patch
Patch4: system-config-printer-utf8-964673.patch
Patch5: system-config-printer-utf8-965578.patch
Patch6: system-config-printer-utf8-965771.patch
Patch7: system-config-printer-utf8-969846.patch
Patch8: system-config-printer-utf8-971417.patch
Patch9: system-config-printer-utf8-971548.patch
Patch10: system-config-printer-utf8-968142.patch
Patch11: system-config-printer-typo.patch
Patch12: system-config-printer-notify-urgency.patch
Patch13: system-config-printer-pointer-grab.patch
Patch14: system-config-printer-np-traceback.patch
Patch15: system-config-printer-rename.patch
Patch16: system-config-printer-notification-new.patch
Patch17: system-config-printer-utf8-971973.patch
Patch18: system-config-printer-statusicon-geometry.patch
Patch19: system-config-printer-remote-missing.patch
Patch20: system-config-printer-rename-race.patch
Patch21: system-config-printer-utf8-978970.patch
Patch22: system-config-printer-misplaced-paren.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
@ -89,57 +68,6 @@ printers.
# Don't start the applet in GNOME.
%patch1 -p1 -b .no-applet-in-gnome
# Fixes for UTF-8 encoding issues (bug #957444, bug #961882,
# bug #962207, bug #964673, bug #965578, bug #969846, bug #971417,
# bug #971548, bug #968142).
%patch2 -p1 -b .utf8-961882
%patch3 -p1 -b .utf8-962207
%patch4 -p1 -b .utf8-964673
%patch5 -p1 -b .utf8-965578
%patch6 -p1 -b .utf8-965771
%patch7 -p1 -b .utf8-969846
%patch8 -p1 -b .utf8-971417
%patch9 -p1 -b .utf8-971548
%patch10 -p1 -b .utf8-968142
# Fixed typo which could cause a traceback (bug #965678).
%patch11 -p1 -b .typo
# Notify urgencies have new names with gi.repository (bug #970646).
%patch12 -p1 -b .notify-urgency
# Removed old pointer/keyboard grabbing code as it no longer works
# (bug #971459).
%patch13 -p1 -b .pointer-grab
# Fixed new printer dialog traceback (bug #969916).
%patch14 -p1 -b .np-traceback
# Use the right signal for spotting when editing is done when renaming
# a printer (bug #971404).
%patch15 -p1 -b .rename
# Fix Notify.Notification creation (bug #974845).
%patch16 -p1 -b .notification-new
# Fixed another codec issue (bug #971973).
%patch17 -p1 -b .utf8-971973
# Another fix from the move to gi.repository (bug #973662).
%patch18 -p1 -b .statusicon-geometry
# Don't check for missing drivers in remote printers (bug #975058)
%patch19 -p1 -b .remote-missing
# Avoid race when renaming printer (bug #975705).
%patch20 -p1 -b .rename-race
# Fixed another codec issue (bug #978970).
%patch21 -p1 -b .utf8-978970
# Fixed misplaced parenthesis (bug #979119).
%patch22 -p1 -b .misplaced-paren
%build
%configure --with-udev-rules
@ -239,6 +167,9 @@ touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris
exit 0
%changelog
* Tue Aug 20 2013 Tim Waugh <twaugh@redhat.com> 1.4.2-1
- 1.4.2.
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild