Compare commits

..

No commits in common. 'c9' and 'i8' have entirely different histories.
c9 ... i8

2
.gitignore vendored

@ -1 +1 @@
SOURCES/system-config-printer-1.5.15.tar.xz SOURCES/system-config-printer-1.5.11.tar.gz

@ -1 +1 @@
766ffe01642cbc959ea34ee01cbe4e7116a514ed SOURCES/system-config-printer-1.5.15.tar.xz d07abc566bd060a1c4a05c5e432a12513e68a2db SOURCES/system-config-printer-1.5.11.tar.gz

@ -0,0 +1,41 @@
From f52f192d241f49334aa46dca1fe9c22b2ee37ff3 Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <antonio.larrosa@gmail.com>
Date: Thu, 31 May 2018 12:07:19 +0200
Subject: [PATCH] Fallback to using LC_CTYPE if LC_MESSAGES is empty and fix
_language use
On openSUSE, LC_MESSAGES is not set by default, so fallback to LC_CTYPE in
that case.
Also, self._language is not a list (unlike in other classes) but the language
itself, so if we get the first element, we would be getting the first letter,
not the language.
---
scp-dbus-service.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scp-dbus-service.py b/scp-dbus-service.py
index 1338836b..b3c03217 100644
--- a/scp-dbus-service.py
+++ b/scp-dbus-service.py
@@ -471,6 +471,8 @@ class ConfigPrinting(dbus.service.Object):
self._jobappletpath = None
self._ppds = None
self._language = locale.getlocale (locale.LC_MESSAGES)[0]
+ if not self._language:
+ self._language = locale.getlocale (locale.LC_CTYPE)[0]
def destroy (self):
self._cupsconn.destroy ()
@@ -511,7 +513,7 @@ class ConfigPrinting(dbus.service.Object):
def GetBestDrivers(self, device_id, device_make_and_model, device_uri,
reply_handler, error_handler):
GetBestDriversRequest (device_id, device_make_and_model, device_uri,
- self._cupsconn, self._language[0],
+ self._cupsconn, self._language,
reply_handler, error_handler)
@dbus.service.method(dbus_interface=CONFIG_IFACE,
--
2.17.2

@ -0,0 +1,29 @@
From 4ab0958643827777f526b180ece874d40009986d Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Thu, 27 Sep 2018 17:27:39 +0200
Subject: [PATCH] Fix TypeError raised by debugprint call
- this error is caused by typo in options.py:424 debugprint call
- debugprint function takes only one parameter so i think it should
have been formated string
- fix https://bugzilla.redhat.com/show_bug.cgi?id=1619593
---
options.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/options.py b/options.py
index 4dc0b1fe..d756f98d 100644
--- a/options.py
+++ b/options.py
@@ -421,7 +421,7 @@ class OptionSelectOne(Option):
self.selector.set_active(selected)
else:
debugprint("Unknown value for %s: %s" % (name, value))
- debugprint("Choices:", supported)
+ debugprint("Choices: %s" % (supported))
if len(supported) > 0:
debugprint("Selecting from choices:", supported[0])
self.selector.set_active(0)
--
2.17.2

@ -0,0 +1,26 @@
From 027ed8683a0ec30dbe705fe4d8f31c8ccb973199 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Thu, 30 Aug 2018 12:05:53 +0200
Subject: [PATCH] Fix typo in debugprint call
(https://github.com/zdohnal/system-config-printer/issues/105)
---
newprinter.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newprinter.py b/newprinter.py
index 850c986b..051fc253 100644
--- a/newprinter.py
+++ b/newprinter.py
@@ -1049,7 +1049,7 @@ class NewPrinterGUI(GtkGUI):
debugprint('No packages for driver')
return None
if len(arches) > 1:
- debugprint('Returned more than one matching architecture, please report this as a bug: %s', repr (arches))
+ debugprint('Returned more than one matching architecture, please report this as a bug: %s' % repr (arches))
return None
pkgs = pkgs[arches[0]]
--
2.17.2

@ -0,0 +1,731 @@
From 8193fc299431ca74734c1fb4a137e9878b1f0a05 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere.ru>
Date: Tue, 29 Aug 2023 17:03:05 +0300
Subject: [PATCH] Fixed text in python files for translation
---
applet.py | 43 ++++++++++-----
authconn.py | 13 +++--
jobviewer.py | 116 ++++++++++++++++++++++++++-------------
newprinter.py | 66 ++++++++++++----------
ppdsloader.py | 7 ++-
printerproperties.py | 61 +++++++++++---------
pysmb.py | 24 +++++---
system-config-printer.py | 8 ++-
8 files changed, 214 insertions(+), 124 deletions(-)
diff --git a/applet.py b/applet.py
index 959e5c8..d625f4c 100644
--- a/applet.py
+++ b/applet.py
@@ -47,6 +47,21 @@ from gi.repository import Notify
APPDIR="/usr/share/system-config-printer"
ICON="printer"
+# MSVSphere
+TEXT_missing_drv = _("Missing printer driver")
+TEXT_no_drv_for = _("No printer driver for %s.")
+TEXT_no_drv = _("No driver for this printer.")
+TEXT_search = _("Search")
+TEXT_printer_added = _("Printer added")
+TEXT_install_drv = _("Install printer driver")
+TEXT_reg_drv_inst = _("`%s' requires driver installation: %s.")
+TEXT_is_ready = _("`%s' is ready for printing.")
+TEXT_test_page = _("Print Test Page")
+TEXT_configure = _("Configure")
+TEXT_has_been_added = _("`%s' has been added, using the `%s' driver.")
+TEXT_find_drv = _("Find driver")
+
+
# We need to call Notify.init before we can check the server for caps
Notify.init('System Config Printer Notification')
@@ -111,21 +126,21 @@ class NewPrinterNotification(dbus.service.Object):
if name.find("/") >= 0:
# name is a URI, no queue was generated, because no suitable
# driver was found
- title = _("Missing printer driver")
+ title = TEXT_missing_drv
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
if (mfg and mdl) or des:
if (mfg and mdl):
device = "%s %s" % (mfg, mdl)
else:
device = des
- text = _("No printer driver for %s.") % device
+ text = TEXT_no_drv_for % device
else:
- text = _("No driver for this printer.")
+ text = TEXT_no_drv
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)
- n.add_action ("setup-printer", _("Search"),
+ n.add_action ("setup-printer", TEXT_search,
lambda x, y:
self.setup_printer (x, y, name, devid))
else:
@@ -162,14 +177,14 @@ class NewPrinterNotification(dbus.service.Object):
(make, model) = ppdMakeModelSplit (printer['printer-make-and-model'])
driver = make + " " + model
if status < self.STATUS_GENERIC_DRIVER:
- title = _("Printer added")
+ title = TEXT_printer_added
else:
- title = _("Missing printer driver")
+ title = TEXT_missing_drv
if len (missing_pkgs) > 0:
pkgs = reduce (lambda x,y: x + ", " + y, missing_pkgs)
- title = _("Install printer driver")
- text = (_("`%s' requires driver installation: %s.") %
+ title = TEXT_install_drv
+ text = ( TEXT_reg_drv_inst %
(name, pkgs))
n = Notify.Notification.new (title, text, 'printer')
import installpackage
@@ -193,26 +208,26 @@ class NewPrinterNotification(dbus.service.Object):
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
+ text = TEXT_is_ready % name
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"),
+ n.add_action ("test-page", TEXT_test_page,
lambda x, y:
self.print_test_page (x, y, name))
- n.add_action ("configure", _("Configure"),
+ n.add_action ("configure", TEXT_configure,
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 = ( TEXT_has_been_added %
(name, driver))
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"),
+ n.add_action ("test-page", TEXT_test_page,
lambda x, y:
self.print_test_page (x, y, name, devid))
- n.add_action ("find-driver", _("Find driver"),
+ n.add_action ("find-driver", TEXT_find_drv,
lambda x, y:
self.find_driver (x, y, name, devid))
n.set_timeout (Notify.EXPIRES_NEVER)
diff --git a/authconn.py b/authconn.py
index 2a645dc..317e702 100644
--- a/authconn.py
+++ b/authconn.py
@@ -34,11 +34,16 @@ import gettext
gettext.install(domain=config.PACKAGE, localedir=config.localedir)
N_ = lambda x: x
+TEXT_user = _("Username:")
+TEXT_domain = _("Domain:")
+TEXT_password = _("Password:")
+TEXT_auth = _("Authentication")
+
cups.require("1.9.60")
class AuthDialog(Gtk.Dialog):
- AUTH_FIELD={'username': N_("Username:"),
- 'password': N_("Password:"),
- 'domain': N_("Domain:")}
+ AUTH_FIELD={'username': N_(TEXT_user),
+ 'password': N_(TEXT_password),
+ 'domain': N_(TEXT_domain)}
def __init__ (self, title=None, parent=None,
flags=Gtk.DialogFlags.MODAL,
@@ -47,7 +52,7 @@ class AuthDialog(Gtk.Dialog):
auth_info_required=None,
allow_remember=False):
if title is None:
- title = _("Authentication")
+ title = TEXT_auth
if auth_info_required is None:
auth_info_required = ['username', 'password']
Gtk.Dialog.__init__ (self, title, parent, flags, buttons)
diff --git a/jobviewer.py b/jobviewer.py
index 6d9309f..11ad7d6 100644
--- a/jobviewer.py
+++ b/jobviewer.py
@@ -70,6 +70,46 @@ ICON="printer"
ICON_SIZE=22
SEARCHING_ICON="document-print-preview"
+# MSVSphere
+TEXT_my_jobs_on = _("my jobs on %s")
+TEXT_my_jobs = _("my jobs")
+TEXT_all_jobs = _("all jobs")
+TEXT_doc_prn_status = _("Document Print Status (%s)")
+TEXT_job = _("Job")
+TEXT_user = _("User")
+TEXT_doc = _("Document")
+TEXT_prn = _("Printer")
+TEXT_size = _("Size")
+TEXT_time_subm = _("Time submitted")
+TEXT_status = _("Status")
+TEXT_cancel = _("_Cancel")
+TEXT_del = _("_Delete")
+TEXT_hold = _("_Hold")
+TEXT_release = _("_Release")
+TEXT_reprint = _("Re_print")
+TEXT_retrieve = _("Re_trieve")
+TEXT_move_to = _("_Move To")
+TEXT_auth = _("_Authenticate")
+TEXT_view_attr = _("_View Attributes")
+TEXT_close_wnd = _("Close this window")
+TEXT_del_jobs = _("Delete Jobs")
+TEXT_del_jobs_ask = _("Do you really want to delete these jobs?")
+TEXT_del_job = _("Delete Job")
+TEXT_del_job_ask = _("Do you really want to delete this job?")
+TEXT_cancel_jobs = _("Cancel Jobs")
+TEXT_cancel_jobs_ask = _("Do you really want to cancel these jobs?")
+TEXT_cancel_job = _("Cancel Job")
+TEXT_cancel_job_ask = _("Do you really want to cancel this job?")
+TEXT_keep_prn = _("Keep Printing")
+TEXT_deleting = _("deleting job")
+TEXT_canceling = _("canceling job")
+TEXT_cancel_selected = _("Cancel selected jobs")
+TEXT_delete_selected = _("Delete selected jobs")
+TEXT_hold_selected = _("Hold selected jobs")
+TEXT_release_selected = _("Release selected jobs")
+TEXT_reprint_selected = _("Reprint selected jobs")
+TEXT_retrieve_selected = _("Retrieve selected jobs")
+
# We need to call Notify.init before we can check the server for caps
Notify.init('System Config Printer Notification')
@@ -252,22 +292,22 @@ class CancelJobsOperation(GObject.GObject):
self.encryption = encryption
if purge_job:
if len(self.jobids) > 1:
- dialog_title = _("Delete Jobs")
- dialog_label = _("Do you really want to delete these jobs?")
+ dialog_title = TEXT_del_jobs
+ dialog_label = TEXT_del_jobs_ask
else:
- dialog_title = _("Delete Job")
- dialog_label = _("Do you really want to delete this job?")
+ dialog_title = TEXT_del_job
+ dialog_label = TEXT_del_job_ask
else:
if len(self.jobids) > 1:
- dialog_title = _("Cancel Jobs")
- dialog_label = _("Do you really want to cancel these jobs?")
+ dialog_title = TEXT_cancel_jobs
+ dialog_label = TEXT_cancel_jobs_ask
else:
- dialog_title = _("Cancel Job")
- dialog_label = _("Do you really want to cancel this job?")
+ dialog_title = TEXT_cancel_job
+ dialog_label = TEXT_cancel_job_ask
dialog = Gtk.Dialog (title=dialog_title, transient_for=parent,
modal=True, destroy_with_parent=True)
- dialog.add_buttons (_("Keep Printing"), Gtk.ResponseType.NO,
+ dialog.add_buttons (TEXT_keep_prn, Gtk.ResponseType.NO,
dialog_title, Gtk.ResponseType.YES)
dialog.set_default_response (Gtk.ResponseType.NO)
dialog.set_border_width (6)
@@ -334,9 +374,9 @@ class CancelJobsOperation(GObject.GObject):
self.connection = connection
if self.purge_job:
- operation = _("deleting job")
+ operation = TEXT_deleting
else:
- operation = _("canceling job")
+ operation = TEXT_canceling
self.connection._begin_operation (operation)
self.connection.cancelJob (self.jobids[0], self.purge_job,
@@ -434,25 +474,25 @@ class JobViewer (GtkGUI):
job_action_group = Gtk.ActionGroup (name="JobActionGroup")
job_action_group.add_actions ([
- ("cancel-job", Gtk.STOCK_CANCEL, _("_Cancel"), None,
- _("Cancel selected jobs"), self.on_job_cancel_activate),
- ("delete-job", Gtk.STOCK_DELETE, _("_Delete"), None,
- _("Delete selected jobs"), self.on_job_delete_activate),
- ("hold-job", Gtk.STOCK_MEDIA_PAUSE, _("_Hold"), None,
- _("Hold selected jobs"), self.on_job_hold_activate),
- ("release-job", Gtk.STOCK_MEDIA_PLAY, _("_Release"), None,
- _("Release selected jobs"), self.on_job_release_activate),
- ("reprint-job", Gtk.STOCK_REDO, _("Re_print"), None,
- _("Reprint selected jobs"), self.on_job_reprint_activate),
- ("retrieve-job", Gtk.STOCK_SAVE_AS, _("Re_trieve"), None,
- _("Retrieve selected jobs"), self.on_job_retrieve_activate),
- ("move-job", None, _("_Move To"), None, None, None),
- ("authenticate-job", None, _("_Authenticate"), None, None,
+ ("cancel-job", Gtk.STOCK_CANCEL, TEXT_cancel, None,
+ TEXT_cancel_selected, self.on_job_cancel_activate),
+ ("delete-job", Gtk.STOCK_DELETE, TEXT_del, None,
+ TEXT_delete_selected, self.on_job_delete_activate),
+ ("hold-job", Gtk.STOCK_MEDIA_PAUSE, TEXT_hold, None,
+ TEXT_hold_selected, self.on_job_hold_activate),
+ ("release-job", Gtk.STOCK_MEDIA_PLAY, TEXT_release, None,
+ TEXT_release_selected, self.on_job_release_activate),
+ ("reprint-job", Gtk.STOCK_REDO, TEXT_reprint, None,
+ TEXT_reprint_selected, self.on_job_reprint_activate),
+ ("retrieve-job", Gtk.STOCK_SAVE_AS, TEXT_retrieve, None,
+ TEXT_retrieve_selected, self.on_job_retrieve_activate),
+ ("move-job", None, TEXT_move_to, None, None, None),
+ ("authenticate-job", None, TEXT_auth, None, None,
self.on_job_authenticate_activate),
- ("job-attributes", None, _("_View Attributes"), None, None,
+ ("job-attributes", None, TEXT_view_attr, None, None,
self.on_job_attributes_activate),
("close", Gtk.STOCK_CLOSE, None, "<ctrl>w",
- _("Close this window"), self.on_delete_event)
+ TEXT_close_wnd, self.on_delete_event)
])
self.job_ui_manager = Gtk.UIManager ()
self.job_ui_manager.insert_action_group (job_action_group, -1)
@@ -515,11 +555,11 @@ class JobViewer (GtkGUI):
self.toolbar.insert (item, -1)
for skip, ellipsize, name, setter in \
- [(False, False, _("Job"), self._set_job_job_number_text),
- (True, False, _("User"), self._set_job_user_text),
- (False, True, _("Document"), self._set_job_document_text),
- (False, True, _("Printer"), self._set_job_printer_text),
- (False, False, _("Size"), self._set_job_size_text)]:
+ [(False, False, TEXT_job, self._set_job_job_number_text),
+ (True, False, TEXT_user, self._set_job_user_text),
+ (False, True, TEXT_doc, self._set_job_document_text),
+ (False, True, TEXT_prn, self._set_job_printer_text),
+ (False, False, TEXT_size, self._set_job_size_text)]:
if applet and skip:
# Skip the user column when running as applet.
continue
@@ -535,11 +575,11 @@ class JobViewer (GtkGUI):
self.treeview.append_column(column)
cell = Gtk.CellRendererText ()
- column = Gtk.TreeViewColumn (_("Time submitted"), cell, text=1)
+ column = Gtk.TreeViewColumn (TEXT_time_subm, cell, text=1)
column.set_resizable (True)
self.treeview.append_column (column)
- column = Gtk.TreeViewColumn (_("Status"))
+ column = Gtk.TreeViewColumn (TEXT_status)
icon = Gtk.CellRendererPixbuf ()
column.pack_start (icon, False)
text = Gtk.CellRendererText ()
@@ -569,15 +609,15 @@ class JobViewer (GtkGUI):
if my_jobs:
if specific_dests:
- title = _("my jobs on %s") % the_dests
+ title = TEXT_my_jobs_on % the_dests
else:
- title = _("my jobs")
+ title = TEXT_my_jobs
else:
if specific_dests:
title = "%s" % the_dests
else:
- title = _("all jobs")
- self.JobsWindow.set_title (_("Document Print Status (%s)") % title)
+ title = TEXT_all_jobs
+ self.JobsWindow.set_title (TEXT_doc_prn_status % title)
if parent:
self.JobsWindow.set_transient_for (parent)
diff --git a/newprinter.py b/newprinter.py
index 850c986..da0e959 100644
--- a/newprinter.py
+++ b/newprinter.py
@@ -72,6 +72,25 @@ gettext.install(domain=config.PACKAGE, localedir=config.localedir)
TEXT_adjust_firewall = _("The firewall may need adjusting in order to "
"detect network printers. Adjust the "
"firewall now?")
+# MSVSphere
+TEXT_adjust_firewall_header = _("Adjust Firewall")
+TEXT_adjust_firewall_NO_button = _("Do It Later")
+TEXT_adjust_firewall_YES_button = _("Adjust Firewall")
+TEXT_secondary_text_IPP = _("Allow all incoming IPP Browse packets")
+TEXT_secondary_text_mDNS = _("Allow all incoming mDNS traffic")
+TEXT_secondary_text_SMB = _("Allow all incoming SMB/CIFS browse packets")
+TEXT_show_info_dialog_header = _("No Print Shares")
+TEXT_show_info_dialog_body = _("There were no print shares found. "
+ "Please check that the Samba service is "
+ "marked as trusted in your firewall "
+ "configuration.")
+TEXT_searching = _("Searching")
+TEXT_searching_for_drivers = _("Searching for drivers")
+TEXT_share_verified = _("Print Share Verified")
+TEXT_share_verified_text = _("This print share is accessible.")
+TEXT_share_inaccessible = _("Print Share Inaccessible")
+TEXT_share_inaccessible_text = _("This print share is not accessible.")
+TEXT_no_printer_was_found_at = _("No printer was found at that address.")
def validDeviceURI (uri):
"""Returns True is the provided URI is valid."""
@@ -1675,7 +1694,7 @@ class NewPrinterGUI(GtkGUI):
self.searchedfordriverpackages = True
self._searchdialog_canceled = False
- fmt = _("Searching")
+ fmt = TEXT_searching
self._searchdialog = Gtk.MessageDialog (
parent=self.NewPrinterWindow,
modal=True,
@@ -1684,8 +1703,7 @@ class NewPrinterGUI(GtkGUI):
buttons=Gtk.ButtonsType.CANCEL,
text=fmt)
- self._searchdialog.format_secondary_text (
- _("Searching for drivers"))
+ self._searchdialog.format_secondary_text (TEXT_searching_for_drivers)
self.opreq = OpenPrintingRequest ()
self._searchdialog.connect (
@@ -2275,13 +2293,10 @@ class NewPrinterGUI(GtkGUI):
secondary_text = TEXT_adjust_firewall + "\n\n"
if not ipp_allowed:
- secondary_text += ("- " +
- _("Allow all incoming IPP Browse packets") +
- "\n")
+ secondary_text += "- " + TEXT_secondary_text_IPP + "\n"
f.add_service (firewallsettings.IPP_CLIENT_SERVICE)
if not mdns_allowed:
- secondary_text += ("- " +
- _("Allow all incoming mDNS traffic") + "\n")
+ secondary_text += "- " + TEXT_secondary_text_mDNS + "\n"
f.add_service (firewallsettings.MDNS_SERVICE)
if not allowed:
@@ -2291,10 +2306,10 @@ class NewPrinterGUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text= _("Adjust Firewall"))
+ text= TEXT_adjust_firewall_header)
dialog.format_secondary_markup (secondary_text)
- dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
- _("Adjust Firewall"), Gtk.ResponseType.YES)
+ dialog.add_buttons (TEXT_adjust_firewall_NO_button, Gtk.ResponseType.NO,
+ TEXT_adjust_firewall_YES_button, Gtk.ResponseType.YES)
dialog.connect ('response', self.adjust_firewall_response)
dialog.show ()
except (dbus.DBusException, Exception):
@@ -2570,11 +2585,7 @@ class NewPrinterGUI(GtkGUI):
if store.get_iter_first () is None:
self.SMBBrowseDialog.hide ()
- show_info_dialog (_("No Print Shares"),
- _("There were no print shares found. "
- "Please check that the Samba service is "
- "marked as trusted in your firewall "
- "configuration."),
+ show_info_dialog (TEXT_show_info_dialog_header, TEXT_show_info_dialog_body,
parent=self.NewPrinterWindow)
def smb_select_function (self, selection, model, path, path_selected, data):
@@ -2765,13 +2776,11 @@ class NewPrinterGUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text=_("Adjust Firewall"))
- secondary_text += ("- " +
- _("Allow all incoming SMB/CIFS "
- "browse packets"))
+ text=TEXT_adjust_firewall_header)
+ secondary_text += "- " + TEXT_secondary_text_SMB
dialog.format_secondary_markup (secondary_text)
- dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
- _("Adjust Firewall"), Gtk.ResponseType.YES)
+ dialog.add_buttons (TEXT_adjust_firewall_NO_button, Gtk.ResponseType.NO,
+ TEXT_adjust_firewall_YES_button, Gtk.ResponseType.YES)
response = dialog.run ()
dialog.destroy ()
@@ -2887,16 +2896,16 @@ class NewPrinterGUI(GtkGUI):
ready (self.NewPrinterWindow)
if accessible:
- show_info_dialog (_("Print Share Verified"),
- _("This print share is accessible."),
+ show_info_dialog (TEXT_share_verified,
+ TEXT_share_verified_text,
parent=self.NewPrinterWindow)
return
if not canceled:
- text = _("This print share is not accessible.")
+ text = TEXT_share_inaccessible_text
if reason:
text = reason
- show_error_dialog (_("Print Share Inaccessible"), text,
+ show_error_dialog (TEXT_share_inaccessible, text,
parent=self.NewPrinterWindow)
def entry_changed(self, entry, allowed_chars):
@@ -3503,10 +3512,7 @@ class NewPrinterGUI(GtkGUI):
self.entNPTNetworkHostname.set_sensitive (True)
self.btnNetworkFind.set_sensitive (True)
if self.network_found == 0:
- self.lblNetworkFindNotFound.set_markup ('<i>' +
- _("No printer was "
- "found at that "
- "address.") + '</i>')
+ self.lblNetworkFindNotFound.set_markup ('<i>' + TEXT_no_printer_was_found_at + '</i>')
self.lblNetworkFindNotFound.show ()
Gdk.threads_leave ()
diff --git a/ppdsloader.py b/ppdsloader.py
index 7be92ee..d56a2b7 100644
--- a/ppdsloader.py
+++ b/ppdsloader.py
@@ -33,6 +33,9 @@ import config
import gettext
gettext.install(domain=config.PACKAGE, localedir=config.localedir)
+TEXT_searching = _("Searching")
+TEXT_searching_for_drivers = _("Searching for drivers")
+
class PPDsLoader(GObject.GObject):
"""
1. If PackageKit support is available, and this is a local server,
@@ -83,14 +86,14 @@ class PPDsLoader(GObject.GObject):
debugprint ("Failed to get session bus")
self._bus = None
- fmt = _("Searching")
+ fmt = TEXT_searching
self._dialog = Gtk.MessageDialog (parent=parent,
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.CANCEL,
text=fmt)
- self._dialog.format_secondary_text (_("Searching for drivers"))
+ self._dialog.format_secondary_text (TEXT_searching_for_drivers)
self._dialog.connect ("response", self._dialog_response)
diff --git a/printerproperties.py b/printerproperties.py
index ff85664..42722eb 100755
--- a/printerproperties.py
+++ b/printerproperties.py
@@ -49,6 +49,25 @@ from newprinter import busy, ready
import ppdippstr
pkgdata = config.pkgdatadir
+# MSVSphere
+TEXT_inst_opts = _("Installable Options")
+TEXT_prn_opts = _("Printer Options")
+TEXT_submitted = _("Submitted")
+TEXT_test_page_submitted = _("Test page submitted as job %d")
+TEXT_maintenance_cmd_submitted = _("Maintenance command submitted as job %d")
+TEXT_not_possible = _("Not possible")
+TEXT_remote_srv_not_accept = _("The remote server did not accept "
+ "the print job, most likely "
+ "because the printer is not "
+ "shared.")
+TEXT_raw_queue = _("Raw Queue")
+TEXT_unable_get_queue = _("Unable to get queue details. Treating queue "
+ "as raw.")
+TEXT_error = _("Error")
+TEXT_ppd_file_damaged = _("The PPD file for this queue "
+ "is damaged.")
+TEXT_problem_connect = _("There was a problem connecting to "
+ "the CUPS server.")
def CUPS_server_hostname ():
host = cups.getServer ()
@@ -954,8 +973,8 @@ class PrinterPropertiesDialog(GtkGUI):
optionsbold = True
else:
self.btnConflict.hide()
- installabletext = _("Installable Options")
- optionstext = _("Printer Options")
+ installabletext = TEXT_inst_opts
+ optionstext = TEXT_prn_opts
if installablebold:
installabletext = "<b>%s</b>" % installabletext
if optionsbold:
@@ -1200,11 +1219,8 @@ class PrinterPropertiesDialog(GtkGUI):
if (e == cups.IPP_NOT_AUTHORIZED and
self._host != 'localhost' and
self._host[0] != '/'):
- show_error_dialog (_("Not possible"),
- _("The remote server did not accept "
- "the print job, most likely "
- "because the printer is not "
- "shared."),
+ show_error_dialog (TEXT_not_possible,
+ TEXT_remote_srv_not_accept,
self.parent)
else:
show_IPP_Error(e, msg, self.parent)
@@ -1213,8 +1229,8 @@ class PrinterPropertiesDialog(GtkGUI):
cups.setUser (user)
if job_id is not None:
- show_info_dialog (_("Submitted"),
- _("Test page submitted as job %d") % job_id,
+ show_info_dialog (TEXT_submitted,
+ TEXT_test_page_submitted % job_id,
parent=self.parent)
def maintenance_command (self, command):
@@ -1233,19 +1249,15 @@ class PrinterPropertiesDialog(GtkGUI):
format=format,
file=tmpfile.name,
user=cups.getUser ())
- show_info_dialog (_("Submitted"),
- _("Maintenance command submitted as "
- "job %d") % job_id,
+ show_info_dialog (TEXT_submitted,
+ TEXT_maintenance_cmd_submitted % job_id,
parent=self.parent)
except cups.IPPError as e:
(e, msg) = e.args
if (e == cups.IPP_NOT_AUTHORIZED and
self.printer.name != 'localhost'):
- show_error_dialog (_("Not possible"),
- _("The remote server did not accept "
- "the print job, most likely "
- "because the printer is not "
- "shared."),
+ show_error_dialog (TEXT_not_possible,
+ TEXT_remote_srv_not_accept,
self.parent)
else:
show_IPP_Error(e, msg, self.parent)
@@ -1315,9 +1327,8 @@ class PrinterPropertiesDialog(GtkGUI):
if e in [cups.IPP_SERVICE_UNAVAILABLE,
cups.IPP_INTERNAL_ERROR]:
- show_dialog(_("Raw Queue"),
- _("Unable to get queue details. Treating queue "
- "as raw."),
+ show_dialog(TEXT_raw_queue,
+ TEXT_unable_get_queue,
Gtk.MessageType.ERROR,
self.parent)
@@ -1328,14 +1339,12 @@ class PrinterPropertiesDialog(GtkGUI):
# NULL without setting an IPP error (so it'll be something
# like a failed connection), or the PPD could not be parsed.
if str (e).startswith ("ppd"):
- show_error_dialog (_("Error"),
- _("The PPD file for this queue "
- "is damaged."),
+ show_error_dialog (TEXT_error,
+ TEXT_ppd_file_damaged,
self.parent)
else:
- show_error_dialog (_("Error"),
- _("There was a problem connecting to "
- "the CUPS server."),
+ show_error_dialog (TEXT_error,
+ TEXT_problem_connect,
self.parent)
raise
diff --git a/pysmb.py b/pysmb.py
index b9afe62..d373dd3 100644
--- a/pysmb.py
+++ b/pysmb.py
@@ -31,6 +31,14 @@ import pwd
import smbc
from debug import *
+TEXT_not_authorized = _("Not authorized")
+TEXT_password_incorrect = _("The password may be incorrect.")
+TEXT_autch = _("Authentication")
+TEXT_autch_header = _("You must log in to access %s.")
+TEXT_user = _("Username:")
+TEXT_domain = _("Domain:")
+TEXT_password = _("Password:")
+
class _None(RuntimeError):
pass
@@ -87,15 +95,15 @@ class AuthContext:
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.CLOSE)
- d.set_title (_("Not authorized"))
+ d.set_title (TEXT_not_authorized)
d.set_markup ('<span weight="bold" size="larger">' +
- _("Not authorized") + '</span>\n\n' +
- _("The password may be incorrect."))
+ TEXT_not_authorized + '</span>\n\n' +
+ TEXT_password_incorrect)
d.run ()
d.destroy ()
# After that, prompt
- d = Gtk.Dialog (title=_("Authentication"),
+ d = Gtk.Dialog (title=TEXT_autch,
transient_for=self.parent,
modal=True)
d.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
@@ -111,7 +119,7 @@ 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.")
+ TEXT_autch_header
% self.for_server +
'</span>')
label.set_use_markup (True)
@@ -122,13 +130,13 @@ class AuthContext:
grid = Gtk.Grid()
grid.set_row_spacing (6)
grid.set_column_spacing (6)
- grid.attach (Gtk.Label(label=_("Username:")), 0, 0, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_user), 0, 0, 1, 1)
username_entry = Gtk.Entry ()
grid.attach (username_entry, 1, 0, 1, 1)
- grid.attach (Gtk.Label(label=_("Domain:")), 0, 1, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_domain), 0, 1, 1, 1)
domain_entry = Gtk.Entry ()
grid.attach (domain_entry, 1, 1, 1, 1)
- grid.attach (Gtk.Label(label=_("Password:")), 0, 2, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_password), 0, 2, 1, 1)
password_entry = Gtk.Entry ()
password_entry.set_activates_default (True)
password_entry.set_visibility (False)
diff --git a/system-config-printer.py b/system-config-printer.py
index f3e2663..d134b46 100755
--- a/system-config-printer.py
+++ b/system-config-printer.py
@@ -104,6 +104,10 @@ sys.path.append (pkgdata)
PlugWindow = None
PlugWindowId = None
+# MSVSphere
+TEXT_test_page = _("Print Test Page")
+TEXT_test_page_ask = _("Would you like to print a test page?")
+
#set program name
GLib.set_prgname("system-config-printer")
@@ -2028,9 +2032,9 @@ class GUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text=_("Would you like to print a test page?"))
+ text=TEXT_test_page_ask)
q.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.NO,
- _("Print Test Page"), Gtk.ResponseType.YES)
+ TEXT_test_page, Gtk.ResponseType.YES)
response = q.run ()
q.destroy ()
if response == Gtk.ResponseType.YES:
--
2.39.2

@ -0,0 +1,35 @@
From 3fee7c63c3aba395a3d8cf0bf4ea0fd2fae695ae Mon Sep 17 00:00:00 2001
From: Laurent Bigonville <bigon@bigon.be>
Date: Mon, 26 Feb 2018 11:54:10 +0100
Subject: [PATCH] Require proper version of GDK and GTK in scp-dbus-service as
well
scp-dbus-service can be D-Bus activated, that means that
gi.require_version() is not called before.
That needs to be kept in sync with the required version in the main
program file.
---
scp-dbus-service.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scp-dbus-service.py b/scp-dbus-service.py
index f0f51efc..3aefc6c6 100644
--- a/scp-dbus-service.py
+++ b/scp-dbus-service.py
@@ -21,9 +21,12 @@
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import dbus.service
+import gi
from gi.repository import GObject
from gi.repository import GLib
+gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
+gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import sys
--
2.17.2

@ -0,0 +1,41 @@
From d818802daefd66eafbcc1618dc731e65de3e08b8 Mon Sep 17 00:00:00 2001
From: Laurent Bigonville <bigon@bigon.be>
Date: Mon, 26 Feb 2018 13:59:26 +0100
Subject: [PATCH] Set programe name for scp-dbus-service as well
scp-dbus-service can be D-Bus activated, that means that the program
name is never set meaning that the icon and the fancy name in the window
list is never set.
This completes the fix for bug #53
---
scp-dbus-service.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scp-dbus-service.py b/scp-dbus-service.py
index 3aefc6c6..1338836b 100644
--- a/scp-dbus-service.py
+++ b/scp-dbus-service.py
@@ -20,8 +20,8 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-import dbus.service
import gi
+import dbus.service
from gi.repository import GObject
from gi.repository import GLib
gi.require_version('Gdk', '3.0')
@@ -55,6 +55,9 @@ CONFIG_JOBVIEWER_IFACE=CONFIG_IFACE + ".JobViewer"
g_ppds = None
g_killtimer = None
+#set program name
+GLib.set_prgname("system-config-printer")
+
class FetchedPPDs(GObject.GObject):
__gsignals__ = {
'ready': (GObject.SIGNAL_RUN_LAST, None, ()),
--
2.17.2

@ -0,0 +1,32 @@
From 96e1f5b242f4be5b20d408e6f526caaaecf34a48 Mon Sep 17 00:00:00 2001
From: Laurent Bigonville <bigon@bigon.be>
Date: Mon, 26 Feb 2018 11:17:22 +0100
Subject: [PATCH] Use ValueError instead of ImportError to catch exception when
importing GIR bindings
When importing specific version of GIR bindings, the ValueError
exception is raised instead of ImportError.
This should make libsecret optional as intended
Fixes: #94
---
jobviewer.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jobviewer.py b/jobviewer.py
index 6d9309ff..16b20300 100644
--- a/jobviewer.py
+++ b/jobviewer.py
@@ -57,7 +57,7 @@ try:
gi.require_version('Secret', '1')
from gi.repository import Secret
USE_SECRET=True
-except ImportError:
+except ValueError:
USE_SECRET=False
import gettext
--
2.17.2

@ -0,0 +1,148 @@
From 42d95b7560c26f0fdf3b4f46823843861948c136 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Thu, 30 Aug 2018 11:52:48 +0200
Subject: [PATCH] define classes for Secret only when libsecret is installed
(https://github.com/zdohnal/system-config-printer/issues/118,
https://github.com/zdohnal/system-config-printer/issues/115)
---
jobviewer.py | 123 ++++++++++++++++++++++++++-------------------------
1 file changed, 62 insertions(+), 61 deletions(-)
diff --git a/jobviewer.py b/jobviewer.py
index 16b20300..86f5feaf 100644
--- a/jobviewer.py
+++ b/jobviewer.py
@@ -73,67 +73,68 @@ SEARCHING_ICON="document-print-preview"
# We need to call Notify.init before we can check the server for caps
Notify.init('System Config Printer Notification')
-NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,
- {
- "user": Secret.SchemaAttributeType.STRING,
- "domain": Secret.SchemaAttributeType.STRING,
- "object": Secret.SchemaAttributeType.STRING,
- "protocol": Secret.SchemaAttributeType.STRING,
- "port": Secret.SchemaAttributeType.INTEGER,
- "server": Secret.SchemaAttributeType.STRING,
- "authtype": Secret.SchemaAttributeType.STRING,
- "uri": Secret.SchemaAttributeType.STRING,
- }
- )
-
-
-class ServiceGet:
- service = Secret.Service()
-
- def on_get_service(self, source, result, unused):
- service = Secret.Service.get_finish(result)
-
- def __init__(self):
- Secret.Service.get(0,
- None,
- self.on_get_service,
- None)
-
- def get_service(self):
- return ServiceGet.service
-
-
-class ItemSearch:
- items = list()
-
- def on_search_item(self, source, result, unused):
- items = Secret.Service.search_finish(None, result)
-
- def __init__(self, service, attrs):
- Secret.Service.search(service,
- NETWORK_PASSWORD,
- attrs,
- Secret.SearchFlags.LOAD_SECRETS,
- None,
- self.on_search_item,
- None)
-
- def get_items(self):
- return ItemSearch.items
-
-
-class PasswordStore:
- def __init__(self, attrs, name, secret):
- Secret.password_store(NETWORK_PASSWORD,
- attrs,
- Secret.COLLECTION_DEFAULT,
- name,
- secret,
- None,
- self.on_password_stored)
-
- def on_password_stored(self, source, result, unused):
- Secret.password_store_finish(result)
+if USE_SECRET:
+ NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,
+ {
+ "user": Secret.SchemaAttributeType.STRING,
+ "domain": Secret.SchemaAttributeType.STRING,
+ "object": Secret.SchemaAttributeType.STRING,
+ "protocol": Secret.SchemaAttributeType.STRING,
+ "port": Secret.SchemaAttributeType.INTEGER,
+ "server": Secret.SchemaAttributeType.STRING,
+ "authtype": Secret.SchemaAttributeType.STRING,
+ "uri": Secret.SchemaAttributeType.STRING,
+ }
+ )
+
+
+ class ServiceGet:
+ service = Secret.Service()
+
+ def on_get_service(self, source, result, unused):
+ service = Secret.Service.get_finish(result)
+
+ def __init__(self):
+ Secret.Service.get(0,
+ None,
+ self.on_get_service,
+ None)
+
+ def get_service(self):
+ return ServiceGet.service
+
+
+ class ItemSearch:
+ items = list()
+
+ def on_search_item(self, source, result, unused):
+ items = Secret.Service.search_finish(None, result)
+
+ def __init__(self, service, attrs):
+ Secret.Service.search(service,
+ NETWORK_PASSWORD,
+ attrs,
+ Secret.SearchFlags.LOAD_SECRETS,
+ None,
+ self.on_search_item,
+ None)
+
+ def get_items(self):
+ return ItemSearch.items
+
+
+ class PasswordStore:
+ def __init__(self, attrs, name, secret):
+ Secret.password_store(NETWORK_PASSWORD,
+ attrs,
+ Secret.COLLECTION_DEFAULT,
+ name,
+ secret,
+ None,
+ self.on_password_stored)
+
+ def on_password_stored(self, source, result, unused):
+ Secret.password_store_finish(result)
class PrinterURIIndex:
--
2.17.2

@ -0,0 +1,66 @@
From e7940de50a7164a2de82e003222ecbf8b10c9ad5 Mon Sep 17 00:00:00 2001
From: xoduddk123 <xoduddk123@naver.com>
Date: Wed, 20 Jun 2018 12:24:13 +0900
Subject: [PATCH] encoding: Modified to use utf-8 in fdopen()
The following error occurred due to encoding problem in fdopen().
root@tykwon:~# cat /var/log/syslog
2018-02-12T17:08:24.208317+09:00 tykwon kernel: usb 1-1.2: new high-speed USB device number 4 using dwc_otg
2018-02-12T17:08:24.309341+09:00 tykwon kernel: usb 1-1.2: New USB device found, idVendor=03f0, idProduct=3b2a
2018-02-12T17:08:24.309398+09:00 tykwon kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2018-02-12T17:08:24.309415+09:00 tykwon kernel: usb 1-1.2: Product: HP Color LaserJet MFP M277n
2018-02-12T17:08:24.309428+09:00 tykwon kernel: usb 1-1.2: Manufacturer: Hewlett-Packard
2018-02-12T17:08:24.318314+09:00 tykwon kernel: usb 1-1.2: SerialNumber: VNBKK97643
2018-02-12T17:08:24.340967+09:00 tykwon root: loading HP Device 001 004
2018-02-12T17:08:25.537224+09:00 tykwon python: io/hpmud/musb.c 2185: [307] hpmud_make_usb_uri() bus=001 dev=004
2018-02-12T17:08:25.540188+09:00 tykwon python: io/hpmud/musb.c 2282: hpmud_make_usb_uri() uri=hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643 bytes_read=53
2018-02-12T17:08:26.510021+09:00 tykwon kernel: usblp 1-1.2:1.1: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x03F0 pid 0x3B2A
2018-02-12T17:08:26.518337+09:00 tykwon kernel: usbcore: registered new interface driver usblp
2018-02-12T17:08:26.523457+09:00 tykwon systemd[1]: Created slice system-configure\x2dprinter.slice.
2018-02-12T17:08:26.525835+09:00 tykwon systemd[1]: Started Configure Plugged-In Printer.
2018-02-12T17:08:26.527132+09:00 tykwon systemd[1]: Reached target Printer.
2018-02-12T17:08:26.546282+09:00 tykwon udev-configure-printer: add usb-001-004
2018-02-12T17:08:26.688365+09:00 tykwon udev-configure-printer: device devpath is /devices/lm1/usb1/1-1/1-1.2
2018-02-12T17:08:26.700706+09:00 tykwon udev-configure-printer: MFG:Hewlett-Packard MDL:HP Color LaserJet MFP M277n SERN:- serial:VNBKK97643
2018-02-12T17:08:31.788344+09:00 tykwon kernel: usblp0: removed
2018-02-12T17:08:31.798343+09:00 tykwon kernel: usblp 1-1.2:1.1: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x03F0 pid 0x3B2A
2018-02-12T17:08:31.870363+09:00 tykwon udev-configure-printer: URI contains USB serial number
2018-02-12T17:08:31.871482+09:00 tykwon udev-configure-printer: URI match: usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1
2018-02-12T17:08:31.872536+09:00 tykwon udev-configure-printer: SERN field matches USB serial number
2018-02-12T17:08:31.873629+09:00 tykwon udev-configure-printer: URI match: hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643
2018-02-12T17:08:31.874594+09:00 tykwon udev-configure-printer: URI of detected printer: usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1, normalized: color laserjet mfp m277n serial vnbkk97643 interface 1
2018-02-12T17:08:31.875782+09:00 tykwon udev-configure-printer: URI of print queue: hp:/usb/HP_LaserJet_Professional_P1106?serial=000000000QN926Y1PR1a, normalized: laserjet professional p1106 serial 000000000qn926y1pr1a
2018-02-12T17:08:31.876985+09:00 tykwon udev-configure-printer: URI of detected printer: hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643, normalized: color laserjet mfp m277n serial vnbkk97643
2018-02-12T17:08:31.878166+09:00 tykwon udev-configure-printer: About to add queue for hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643
2018-02-12T17:08:34.760340+09:00 tykwon udev-add-printer: add_queue: URIs=['hp:/usb/HP_Color_LaserJet_MFP_M277n?serial=VNBKK97643', 'usb://HP/Color%20LaserJet%20MFP%20M277n?serial=VNBKK97643&interface=1']
2018-02-12T17:08:34.766174+09:00 tykwon udev-add-printer: D-Bus method call failed: org.freedesktop.DBus.Error.ServiceUnknown: The name com.redhat.NewPrinterNotification was not provided by any .service files
2018-02-12T17:08:41.722389+09:00 tykwon udev-add-printer: PPD: hplip:1/hp-color_laserjet_pro_mfp_m277-ps.ppd; Status: 0
2018-02-12T17:08:45.763635+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 232, in <module>#012 add_queue (sys.argv[1], sys.argv[2:])
2018-02-12T17:08:45.764840+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 169, in add_queue#012 installer)
2018-02-12T17:08:45.765979+09:00 tykwon udev-add-printer: File "/lib/udev/udev-add-printer", line 75, in create_queue#012 (pkgs, exes) = cupshelpers.missingPackagesAndExecutables (ppd)
2018-02-12T17:08:45.767236+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/site-packages/cupshelpers/cupshelpers.py", line 889, in missingPackagesAndExecutables#012 executables = missingExecutables(ppd)
2018-02-12T17:08:45.768527+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/site-packages/cupshelpers/cupshelpers.py", line 864, in missingExecutables#012 for line in f:
2018-02-12T17:08:45.769834+09:00 tykwon udev-add-printer: File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode#012 return codecs.ascii_decode(input, self.errors)[0]
2018-02-12T17:08:45.771056+09:00 tykwon udev-add-printer: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4175: ordinal not in range(128)
root@tykwon:~#
---
cupshelpers/cupshelpers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cupshelpers/cupshelpers.py b/cupshelpers/cupshelpers.py
index 978ab801..8fe7ead4 100755
--- a/cupshelpers/cupshelpers.py
+++ b/cupshelpers/cupshelpers.py
@@ -859,7 +859,7 @@ def missingExecutables(ppd):
os.unlink (tmpfname)
ppd.writeFd (tmpfd)
os.lseek (tmpfd, 0, os.SEEK_SET)
- f = os.fdopen (tmpfd, "rt")
+ f = os.fdopen (tmpfd, "rt", encoding="utf-8")
search = "*cupsFilter:"
for line in f:
if line.startswith (search):
--
2.17.2

@ -0,0 +1,26 @@
From 8a623c2f038dd85da3df647531c6a881d235523c Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Fri, 23 Mar 2018 13:43:41 +0100
Subject: [PATCH] require Gtk and Gdk version 3.0 in asyncpk1.py
---
asyncpk1.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/asyncpk1.py b/asyncpk1.py
index 65d2e768..849c995f 100644
--- a/asyncpk1.py
+++ b/asyncpk1.py
@@ -22,7 +22,9 @@ import cups
import dbus
from functools import reduce
try:
+ gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
+ gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
except:
pass
--
2.17.2

@ -0,0 +1,15 @@
diff -up system-config-printer-1.5.11/authconn.py.authdialog system-config-printer-1.5.11/authconn.py
--- system-config-printer-1.5.11/authconn.py.authdialog 2018-02-15 11:42:35.074157581 +0100
+++ system-config-printer-1.5.11/authconn.py 2018-02-15 11:43:51.652437359 +0100
@@ -78,11 +78,9 @@ class AuthDialog(Gtk.Dialog):
field = auth_info_required[i]
label = Gtk.Label (label=_(self.AUTH_FIELD.get (field, field)))
label.set_alignment (0, 0.5)
- grid.attach (label, 0, 1, i, i + 1)
grid.attach (label, 0, i, 1, 1)
entry = Gtk.Entry ()
entry.set_visibility (field != 'password')
- grid.attach (entry, 1, 2, i, i + 1, 0, 0)
grid.attach (entry, 1, i, 1, 1)
self.field_entry.append (entry)

@ -4,26 +4,33 @@
# Enable hardened build, as the udev part runs with privilege. # Enable hardened build, as the udev part runs with privilege.
%global _hardened_build 1 %global _hardened_build 1
%global username OpenPrinting %global username zdohnal
Summary: A printer administration tool Summary: A printer administration tool
Name: system-config-printer Name: system-config-printer
Version: 1.5.15 Version: 1.5.11
Release: 4%{?dist} Release: 13%{?dist}.inferit
License: GPLv2+ License: GPLv2+
URL: https://github.com/%{username}/%{name} URL: https://github.com/%{username}/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz
# all upstream patches, remove with new release # all upstream patches, remove with new release
Patch01: system-config-printer-authdialog.patch
Patch02: 0001-Use-ValueError-instead-of-ImportError-to-catch-excep.patch
Patch03: 0001-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch
Patch04: 0001-Set-programe-name-for-scp-dbus-service-as-well.patch
Patch05: 0001-require-Gtk-and-Gdk-version-3.0-in-asyncpk1.py.patch
Patch06: 0001-encoding-Modified-to-use-utf-8-in-fdopen.patch
Patch07: 0001-Fallback-to-using-LC_CTYPE-if-LC_MESSAGES-is-empty-a.patch
Patch08: 0001-define-classes-for-Secret-only-when-libsecret-is-ins.patch
Patch09: 0001-Fix-typo-in-debugprint-call-https-github.com-zdohnal.patch
Patch10: 0001-Fix-TypeError-raised-by-debugprint-call.patch
#MSVSphere
Patch100: 0001-Fixed-text-in-python-files-for-translation.patch
# gcc is no longer in buildroot by default # gcc is no longer in buildroot by default
# gcc is needed for udev-configure-printer.c # gcc is needed for udev-configure-printer.c
BuildRequires: gcc BuildRequires: gcc
# for autosetup
BuildRequires: git-core
# uses make
BuildRequires: make
BuildRequires: cups-devel >= 1.2 BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92 BuildRequires: desktop-file-utils >= 0.2.92
@ -47,6 +54,7 @@ Requires: libnotify%{?_isa}
Requires: python3-cairo%{?_isa} Requires: python3-cairo%{?_isa}
Requires: python3-firewall Requires: python3-firewall
Requires: libcanberra-gtk3 Requires: libcanberra-gtk3
Requires: PackageKit-gtk3-module
%{?systemd_requires} %{?systemd_requires}
%description %description
@ -55,7 +63,6 @@ the user to configure a CUPS print server.
%package libs %package libs
Summary: Libraries and shared code for printer administration tool Summary: Libraries and shared code for printer administration tool
Requires: libnotify
Requires: python3-cups >= 1.9.60 Requires: python3-cups >= 1.9.60
Requires: python3-pycurl Requires: python3-pycurl
Requires: gobject-introspection Requires: gobject-introspection
@ -65,83 +72,61 @@ Requires: python3-dbus
Requires: python3-requests Requires: python3-requests
Suggests: python3-smbc Suggests: python3-smbc
BuildArch: noarch BuildArch: noarch
Obsoletes: %{name}-libs < 1.3.12-10
%description libs %description libs
The common code used by both the graphical and non-graphical parts of The common code used by both the graphical and non-graphical parts of
the configuration tool. the configuration tool.
%if 0%{?rhel} <= 8 || 0%{?fedora}
%package applet %package applet
Summary: Print job notification applet Summary: Print job notification applet
Requires: %{name}-libs Requires: %{name}-libs
%description applet %description applet
Print job notification applet. Print job notification applet.
%endif
%package udev %package udev
Summary: Rules for udev for automatic configuration of USB printers Summary: Rules for udev for automatic configuration of USB printers
Requires: system-config-printer-libs = %{version}-%{release} Requires: system-config-printer-libs = %{version}-%{release}
Obsoletes: hal-cups-utils < 0.6.20
Provides: hal-cups-utils = 0.6.20
%description udev %description udev
The udev rules and helper programs for automatically configuring USB The udev rules and helper programs for automatically configuring USB
printers. printers.
%prep %prep
%autosetup -S git %setup -q
%patch01 -p1 -b .authdialog
%patch02 -p1 -b .upstream0
%patch03 -p1 -b .upstream1
%patch04 -p1 -b .upstream2
%patch05 -p1 -b .upstream3
%patch06 -p1 -b .upstream4
%patch07 -p1 -b .upstream5
%patch08 -p1 -b .upstream6
%patch09 -p1 -b .upstream7
%patch10 -p1 -b .upstream8
%patch100 -p1
%build %build
%configure --with-udev-rules %configure --with-udev-rules
%make_build make %{?_smp_mflags}
%install %install
%make_install make DESTDIR=%buildroot install
%{__mkdir_p} %buildroot%{_localstatedir}/run/udev-configure-printer %{__mkdir_p} %buildroot%{_localstatedir}/run/udev-configure-printer
touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris
# Manually invoke the python byte compile macro for each path that # Manually invoke the python byte compile macro for each path that
# needs byte compilation # needs byte compilation
%py_byte_compile %{__python3} %{buildroot}/%{_datadir}/system-config-printer %py_byte_compile %{__python3} %%{buildroot}%{python3_sitelib}/cupshelpers
%py_byte_compile %{__python3} %%{buildroot}%{datadir}/system-config-printer
%find_lang system-config-printer %find_lang system-config-printer
%if 0%{?rhel} > 8
rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{buildroot}%{_datadir}/%{name}/__pycache__/applet* \
%{buildroot}%{_datadir}/%{name}/applet.py* \
%{buildroot}%{_sysconfdir}/xdg/autostart/print-applet.desktop \
%{buildroot}%{_mandir}/man1/%{name}-applet.1* \
%{buildroot}%{_bindir}/%{name} \
%{buildroot}%{_bindir}/install-printerdriver \
%{buildroot}%{_datadir}/%{name}/__pycache__/check-device-ids* \
%{buildroot}%{_datadir}/%{name}/__pycache__/HIG* \
%{buildroot}%{_datadir}/%{name}/__pycache__/SearchCriterion* \
%{buildroot}%{_datadir}/%{name}/__pycache__/serversettings* \
%{buildroot}%{_datadir}/%{name}/__pycache__/system-config-printer* \
%{buildroot}%{_datadir}/%{name}/__pycache__/ToolbarSearchEntry* \
%{buildroot}%{_datadir}/%{name}/__pycache__/userdefault* \
%{buildroot}%{_datadir}/%{name}/__pycache__/install-printerdriver* \
%{buildroot}%{_datadir}/%{name}/check-device-ids.py* \
%{buildroot}%{_datadir}/%{name}/HIG.py* \
%{buildroot}%{_datadir}/%{name}/SearchCriterion.py* \
%{buildroot}%{_datadir}/%{name}/serversettings.py* \
%{buildroot}%{_datadir}/%{name}/system-config-printer.py* \
%{buildroot}%{_datadir}/%{name}/ToolbarSearchEntry.py* \
%{buildroot}%{_datadir}/%{name}/userdefault.py* \
%{buildroot}%{_datadir}/%{name}/troubleshoot \
%{buildroot}%{_datadir}/%{name}/icons \
%{buildroot}%{_datadir}/%{name}/install-printerdriver.py* \
%{buildroot}%{_datadir}/%{name}/xml/__pycache__ \
%{buildroot}%{_datadir}/%{name}/xml/validate.py* \
%{buildroot}%{_datadir}/%{name}/ui \
%{buildroot}%{_datadir}/applications/system-config-printer.desktop \
%{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml \
%{buildroot}%{_mandir}/man1/%{name}.1* \
%endif
%files libs -f system-config-printer.lang %files libs -f system-config-printer.lang
%doc ChangeLog NEWS ABOUT-NLS AUTHORS ChangeLog-OLD
%license COPYING %license COPYING
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.NewPrinterNotification.conf %config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.NewPrinterNotification.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.PrinterDriversInstaller.conf %config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.PrinterDriversInstaller.conf
@ -149,16 +134,6 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{_datadir}/dbus-1/services/*.service %{_datadir}/dbus-1/services/*.service
%{_bindir}/scp-dbus-service %{_bindir}/scp-dbus-service
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%{_datadir}/%{name}/__pycache__/*
%exclude %{_datadir}/%{name}/__pycache__/check-device-ids*
%exclude %{_datadir}/%{name}/__pycache__/HIG*
%exclude %{_datadir}/%{name}/__pycache__/SearchCriterion*
%exclude %{_datadir}/%{name}/__pycache__/serversettings*
%exclude %{_datadir}/%{name}/__pycache__/system-config-printer*
%exclude %{_datadir}/%{name}/__pycache__/ToolbarSearchEntry*
%exclude %{_datadir}/%{name}/__pycache__/userdefault*
%exclude %{_datadir}/%{name}/__pycache__/install-printerdriver*
%exclude %{_datadir}/%{name}/__pycache__/applet*
%{_datadir}/%{name}/asyncconn.py* %{_datadir}/%{name}/asyncconn.py*
%{_datadir}/%{name}/asyncipp.py* %{_datadir}/%{name}/asyncipp.py*
%{_datadir}/%{name}/asyncpk1.py* %{_datadir}/%{name}/asyncpk1.py*
@ -190,22 +165,16 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{_datadir}/%{name}/smburi.py* %{_datadir}/%{name}/smburi.py*
%{_datadir}/%{name}/statereason.py* %{_datadir}/%{name}/statereason.py*
%{_datadir}/%{name}/timedops.py* %{_datadir}/%{name}/timedops.py*
%dir %{_datadir}/%{name}/__pycache__
%dir %{_datadir}/%{name}/xml
%{_datadir}/%{name}/xml/*.rng
%dir %{_sysconfdir}/cupshelpers %dir %{_sysconfdir}/cupshelpers
%config(noreplace) %{_sysconfdir}/cupshelpers/preferreddrivers.xml %config(noreplace) %{_sysconfdir}/cupshelpers/preferreddrivers.xml
%{python3_sitelib}/cupshelpers %{python3_sitelib}/cupshelpers
%{python3_sitelib}/*.egg-info %{python3_sitelib}/*.egg-info
%if 0%{?rhel} <= 8 || 0%{?fedora}
%files applet %files applet
%{_bindir}/%{name}-applet %{_bindir}/%{name}-applet
%{_datadir}/%{name}/__pycache__/applet*
%{_datadir}/%{name}/applet.py* %{_datadir}/%{name}/applet.py*
%{_sysconfdir}/xdg/autostart/print-applet.desktop %{_sysconfdir}/xdg/autostart/print-applet.desktop
%{_mandir}/man1/%{name}-applet.1* %{_mandir}/man1/%{name}-applet.1*
%endif
%files udev %files udev
%{_prefix}/lib/udev/rules.d/*.rules %{_prefix}/lib/udev/rules.d/*.rules
@ -214,20 +183,11 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) %attr(0644,root,root) %{_localstatedir}/run/udev-configure-printer/usb-uris %ghost %verify(not md5 size mtime) %config(noreplace,missingok) %attr(0644,root,root) %{_localstatedir}/run/udev-configure-printer/usb-uris
%{_unitdir}/configure-printer@.service %{_unitdir}/configure-printer@.service
%if 0%{?rhel} <= 8 || 0%{?fedora}
%files %files
%doc ChangeLog NEWS ABOUT-NLS AUTHORS ChangeLog-OLD %doc ChangeLog NEWS ABOUT-NLS AUTHORS ChangeLog-OLD
%license COPYING %license COPYING
%{_bindir}/%{name} %{_bindir}/%{name}
%{_bindir}/install-printerdriver %{_bindir}/install-printerdriver
%{_datadir}/%{name}/__pycache__/check-device-ids*
%{_datadir}/%{name}/__pycache__/HIG*
%{_datadir}/%{name}/__pycache__/SearchCriterion*
%{_datadir}/%{name}/__pycache__/serversettings*
%{_datadir}/%{name}/__pycache__/system-config-printer*
%{_datadir}/%{name}/__pycache__/ToolbarSearchEntry*
%{_datadir}/%{name}/__pycache__/userdefault*
%{_datadir}/%{name}/__pycache__/install-printerdriver*
%{_datadir}/%{name}/check-device-ids.py* %{_datadir}/%{name}/check-device-ids.py*
%{_datadir}/%{name}/HIG.py* %{_datadir}/%{name}/HIG.py*
%{_datadir}/%{name}/SearchCriterion.py* %{_datadir}/%{name}/SearchCriterion.py*
@ -238,8 +198,8 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{_datadir}/%{name}/troubleshoot %{_datadir}/%{name}/troubleshoot
%{_datadir}/%{name}/icons %{_datadir}/%{name}/icons
%{_datadir}/%{name}/install-printerdriver.py* %{_datadir}/%{name}/install-printerdriver.py*
%dir %{_datadir}/%{name}/xml/__pycache__ %dir %{_datadir}/%{name}/xml
%{_datadir}/%{name}/xml/__pycache__/* %{_datadir}/%{name}/xml/*.rng
%{_datadir}/%{name}/xml/validate.py* %{_datadir}/%{name}/xml/validate.py*
%dir %{_datadir}/%{name}/ui %dir %{_datadir}/%{name}/ui
%{_datadir}/%{name}/ui/*.ui %{_datadir}/%{name}/ui/*.ui
@ -248,84 +208,16 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{_mandir}/man1/%{name}.1* %{_mandir}/man1/%{name}.1*
%post %post
%{_bindir}/rm -f /var/cache/foomatic/foomatic.pickle /bin/rm -f /var/cache/foomatic/foomatic.pickle
exit 0 exit 0
%endif
%changelog %changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.15-4 * Tue Aug 29 2023 Sergey Cherevko <s.cherevko@msvsphere.ru> - 1.5.11-13.inferit
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Fixed text in python files for translation
Related: rhbz#1991688 - Rebuilt for MSVSphere 9.2
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.15-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jan 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.15-1
- 1.5.15, apply eln changes
* Tue Jan 05 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.13-3
- 1750156 - hangs on selection of change PPD (Make and Model)
* Fri Nov 27 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.13-2
- set preferred driver for Dymo LabelWriter 400
* Thu Nov 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.13-1
- 1.15.13
* Mon Oct 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.12-9
- 1884866 - s-c-p: isAlive() is removed, use is_alive()
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.12-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 22 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.12-7
- python3.9 - xml module removed elem.getchildren() method, use list(elem)
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 1.5.12-6
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.5.12-5
- Rebuilt for Python 3.9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 31 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.12-3
- whole fix for #1765915
* Tue Oct 29 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.12-2
- 1765915 - abrt in udev-configure-printer
* Tue Oct 01 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.12-1
- 1.5.12
* Tue Aug 27 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-21
- require libnotify - there can be cases where it is not brought by any other packages
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.5.11-20
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.11-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jul 15 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-18
- 1729453 - system-config-printer does not ship byte-compiled Python files
* Wed May 29 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-17
- upstream was moved to OpenPrinting
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.11-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 02 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-15
- remove packagekit-gtk3-module dependency
* Fri Nov 09 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-14 * Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 1.5.11-13
- deprecate at_console statement - Rebuilt for MSVSphere 8.8
* Mon Oct 15 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-13 * Mon Oct 15 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.11-13
- backport several upstream patches - backport several upstream patches

Loading…
Cancel
Save