rpms/system-config-printer/devel system-config-printer-1.0.x.patch, 1.8, 1.9 system-config-printer.spec, 1.232, 1.233

Tim Waugh twaugh at fedoraproject.org
Fri Dec 12 10:04:56 UTC 2008


Author: twaugh

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

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-1.0.x.patch 
Log Message:
* Fri Dec 12 2008 Tim Waugh <twaugh at redhat.com> 1.0.12-4
- Updated patch for 1.0.x changes:
  - Fix for advanced server settings dialog.
  - Fixes for troubleshooter to restore error_log fetching.


system-config-printer-1.0.x.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.8 -r 1.9 system-config-printer-1.0.x.patch
Index: system-config-printer-1.0.x.patch
===================================================================
RCS file: system-config-printer-1.0.x.patch
diff -N system-config-printer-1.0.x.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ system-config-printer-1.0.x.patch	12 Dec 2008 10:04:54 -0000	1.9
@@ -0,0 +1,4331 @@
+diff --git a/ChangeLog b/ChangeLog
+index 2851eeb..85c3f3e 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,44 @@
++2008-12-11  Tim Waugh  <twaugh at redhat.com>
++
++	* troubleshoot/ErrorLogCheckpoint.py
++	(ErrorLogCheckpoint.enable_clicked): Reconnect after adjusting
++	server settings.
++	* troubleshoot/ErrorLogFetch.py (ErrorLogFetch.button_clicked):
++	Likewise.
++
++2008-12-11  Tim Waugh  <twaugh at redhat.com>
++
++	* troubleshoot/ErrorLogCheckpoint.py
++	(ErrorLogCheckpoint.enable_clicked): Handle values like '1m' for
++	MaxLogSize.
++
++2008-12-11  Tim Waugh  <twaugh at redhat.com>
++
++	* system-config-printer.py (GUI.server_settings_response): Reload
++	server settings after advanced server settings dialog has
++	finished.
++
++2008-12-09  Tim Waugh  <twaugh at redhat.com>
++
++	* system-config-printer.py (GUI.populateList): Allow prompting
++	again even if we disallowed it for one operation.
++
++2008-12-04  Tim Waugh  <twaugh at redhat.com>
++
++	* system-config-printer.py (GUI.fillPrinterTab): Localize a copy
++	of the PPD, retaining the original in-memory representation.
++	(GUI.fillPrinterOptions): Use the localized PPD for widget labels,
++	and the original PPD for value writebacks.
++	(NewPrinterGUI.getNPPPD): Don't localize PPDs here.
++	(NewPrinterGUI.on_btnNPApply_clicked): Likewise.
++
++2008-12-04  Tim Waugh  <twaugh at redhat.com>
++
++	* cupshelpers/cupshelpers.py (Printer.__init__, Printer.getPPD):
++	Cache the temporary PPD filename instead of the in-memory
++	representation, to allow for a separate localized in-memory copy.
++	(Printer.__del__): Remove the temporary PPD file.
++
+ 2008-12-01  Tim Waugh  <twaugh at redhat.com>
+ 
+ 	* configure.in: Version 1.0.12.
+diff --git a/cupshelpers/cupshelpers.py b/cupshelpers/cupshelpers.py
+index a19034f..fcf0f2c 100755
+--- a/cupshelpers/cupshelpers.py
++++ b/cupshelpers/cupshelpers.py
+@@ -38,11 +38,11 @@ class Printer:
+         self.connection = connection
+         self.class_members = []
+         self.update (**kw)
++        self._ppd = None # load on demand
+ 
+-        if self.is_class:
+-            self._ppd = False
+-        else:
+-            self._ppd = None # load on demand
++    def __del__ (self):
++        if self._ppd != None:
++            os.unlink(self._ppd)
+ 
+     def __repr__ (self):
+         return "<cupshelpers.Printer \"%s\">" % self.name
+@@ -184,18 +184,21 @@ class Printer:
+         @returns: cups.PPD object, or False for raw queues
+         @raise cups.IPPError: IPP error
+         """
++        result = None
+         if self._ppd is None:
+             try:
+-                filename = self.connection.getPPD(self.name)
+-                self._ppd = cups.PPD(filename)
+-                self._ppd.localize ()
+-                os.unlink(filename)
++                self._ppd = self.connection.getPPD(self.name)
++                result = cups.PPD (self._ppd)
+             except cups.IPPError, (e, m):
+                 if e == cups.IPP_NOT_FOUND:
+-                    self._ppd = False
++                    result = False
+                 else:
+                     raise
+-        return self._ppd
++
++        if result != False and self._ppd != None:
++            result = cups.PPD (self._ppd)
++
++        return result
+ 
+     def setOption(self, name, value):
+         """
+diff --git a/po/sv.po b/po/sv.po
+index 5a6b7bc..8fcccab 100644
+--- a/po/sv.po
++++ b/po/sv.po
+@@ -10,8 +10,8 @@ msgid ""
+ msgstr ""
+ "Project-Id-Version: system-config-printer\n"
+ "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/bugzilla\n"
+-"POT-Creation-Date: 2008-11-28 17:44+0000\n"
+-"PO-Revision-Date: 2008-11-18 09:12-0500\n"
++"POT-Creation-Date: 2008-11-19 01:18+0000\n"
++"PO-Revision-Date: 2008-12-01 23:34+0100\n"
+ "Last-Translator: Daniel Nylander <po at danielnylander.se>\n"
+ "Language-Team: Swedish <tp-sv at listor.tp-sv.se>\n"
+ "MIME-Version: 1.0\n"
+@@ -43,22 +43,20 @@ msgid "Browse Servers"
+ msgstr "Bläddra servrar"
+ 
+ #: ../AdvancedServerSettings.py:92
+-msgid ""
+-"Usually print servers broadcast their queues.  Specify print servers below "
+-"to periodically ask for queues instead."
+-msgstr ""
+-"Vanligtvis brukar skrivarservrar annonsera ut sina köer. Ange skrivarservrar "
+-"nedan att fråga periodiskt efter köer istället."
++msgid "Usually print servers broadcast their queues.  Specify print servers below to periodically ask for queues instead."
++msgstr "Vanligtvis brukar skrivarservrar annonsera ut sina köer. Ange skrivarservrar nedan att fråga periodiskt efter köer istället."
+ 
+-#: ../AdvancedServerSettings.py:224
++#: ../AdvancedServerSettings.py:213
+ msgid "Enter IP address"
+ msgstr "Ange IP-adress"
+ 
+-#: ../authconn.py:30 ../system-config-printer.glade.h:251
++#: ../authconn.py:30
++#: ../system-config-printer.glade.h:250
+ msgid "Username:"
+ msgstr "Användarnamn:"
+ 
+-#: ../authconn.py:31 ../system-config-printer.glade.h:185
++#: ../authconn.py:31
++#: ../system-config-printer.glade.h:184
+ msgid "Password:"
+ msgstr "Lösenord:"
+ 
+@@ -74,31 +72,33 @@ msgstr "Autentisering"
+ msgid "Operation canceled"
+ msgstr "Operation avbruten"
+ 
+-#: ../authconn.py:265 ../authconn.py:267 ../errordialogs.py:77 ../pysmb.py:80
++#: ../authconn.py:264
++#: ../authconn.py:266
++#: ../errordialogs.py:77
++#: ../pysmb.py:80
+ #: ../pysmb.py:82
+ msgid "Not authorized"
+ msgstr "Inte behörig"
+ 
+-#: ../authconn.py:268 ../pysmb.py:83
++#: ../authconn.py:267
++#: ../pysmb.py:83
+ msgid "The password may be incorrect."
+ msgstr "Lösenordet kan vara felaktigt."
+ 
+-#: ../errordialogs.py:68 ../errordialogs.py:82
++#: ../errordialogs.py:68
++#: ../errordialogs.py:82
+ msgid "CUPS server error"
+ msgstr "Fel i CUPS-server"
+ 
+-#: ../errordialogs.py:69 ../troubleshoot/PrintTestPage.py:326
++#: ../errordialogs.py:69
++#: ../troubleshoot/PrintTestPage.py:322
+ #, python-format
+ msgid "There was an error during the CUPS operation: '%s'."
+ msgstr "Det inträffade ett fel vid CUPS-operationen \"%s\"."
+ 
+ #: ../errordialogs.py:78
+-msgid ""
+-"The password may be incorrect, or the server may be configured to deny "
+-"remote administration."
+-msgstr ""
+-"Lösenordet kan vara fel eller servern kan vara konfigurerad att neka "
+-"fjärradministration."
++msgid "The password may be incorrect, or the server may be configured to deny remote administration."
++msgstr "Lösenordet kan vara fel eller servern kan vara konfigurerad att neka fjärradministration."
+ 
+ #: ../errordialogs.py:84
+ msgid "Bad request"
+@@ -120,7 +120,8 @@ msgstr "Uppgradering krävs"
+ msgid "Server error"
+ msgstr "Serverfel"
+ 
+-#: ../errordialogs.py:94 ../system-config-printer.py:804
++#: ../errordialogs.py:94
++#: ../system-config-printer.py:804
[...3938 lines suppressed...]
+-
+ #~ msgid ""
+ #~ "FIXME:%s\n"
+ #~ "This feature is incomplete, and under development."
+ #~ msgstr ""
+ #~ "FIXME:%s\n"
+ #~ "Denna finess är ofullständig och under utveckling."
+-
+ #~ msgid "<b>Download Printer Driver</b>"
+ #~ msgstr "<b>Hämta skrivardrivrutin</b>"
+-
+ #~ msgid "<b>Installed Options</b>"
+ #~ msgstr "<b>Installerade alternativ</b>"
+-
+ #~ msgid "<b>Printers to be members of this Class</b>"
+ #~ msgstr "<b>Skrivare som ska vara medlemmar av denna klass</b>"
+-
+ #~ msgid "<b>Select Connection</b>"
+ #~ msgstr "<b>Välj anslutning</b>"
+ 
+@@ -4723,6 +4125,10 @@ msgstr "Välj standardskrivare"
+ #~ msgstr "Visa utskrifts_kö"
+ 
+ #, fuzzy
++#~ msgid "Printer IP:"
++#~ msgstr "Skrivare"
++
++#, fuzzy
+ #~ msgid "Select a print driver for your printer."
+ #~ msgstr "Välj skrivare från databasen"
+ 
+@@ -4749,3 +4155,4 @@ msgstr "Välj standardskrivare"
+ #, fuzzy
+ #~ msgid "Unknown printer"
+ #~ msgstr "Okänd"
++
+diff --git a/system-config-printer.py b/system-config-printer.py
+index 349c6f0..5844174 100755
+--- a/system-config-printer.py
++++ b/system-config-printer.py
+@@ -765,6 +765,11 @@ class GUI(GtkGUI, monitor.Watcher):
+                 AdvancedServerSettingsDialog (self.cups, dialog)
+             except:
+                 return
++
++            try:
++                self.fillServerTab ()
++            except cups.IPPError:
++                dialog.hide ()
+         else:
+             dialog.hide ()
+ 
+@@ -858,6 +863,8 @@ class GUI(GtkGUI, monitor.Watcher):
+                 show_IPP_Error(e, m, self.MainWindow)
+                 self.printers = {}
+                 self.default_printer = None
++
++            self.cups._set_prompt_allowed (True)
+         else:
+             self.printers = {}
+             self.default_printer = None
+@@ -1750,6 +1757,8 @@ class GUI(GtkGUI, monitor.Watcher):
+ 
+         try:
+             self.ppd = printer.getPPD()
++            self.ppd_local = printer.getPPD()
++            self.ppd_local.localize()
+         except cups.IPPError, (e, m):
+             # Some IPP error other than IPP_NOT_FOUND.
+             show_IPP_Error(e, m, self.MainWindow)
+@@ -1988,19 +1997,20 @@ class GUI(GtkGUI, monitor.Watcher):
+             return
+         ppd = self.ppd
+         ppd.markDefaults()
++        self.ppd_local.markDefaults()
+ 
+         hasInstallableOptions = False
+         
+         # build option tabs
+-        for group in ppd.optionGroups:
++        for group in self.ppd_local.optionGroups:
+             if group.name == "InstallableOptions":
+                 hasInstallableOptions = True
+                 container = self.vbPInstallOptions
+                 tab_nr = self.ntbkPrinter.page_num(self.swPInstallOptions)
+                 if tab_nr == -1:
+-                    self.ntbkPrinter.insert_page(
+-                        self.swPInstallOptions, gtk.Label(group.text),
+-                        self.static_tabs)
++                    self.ntbkPrinter.insert_page(self.swPInstallOptions,
++                                                 gtk.Label(group.text),
++                                                 self.static_tabs)
+                 tab_label = self.lblPInstallOptions
+             else:
+                 frame = gtk.Frame("<b>%s</b>" % group.text)
+@@ -5110,7 +5120,6 @@ class NewPrinterGUI(GtkGUI):
+                 ppd = self.NPDrivers[nr]
+             elif self.rbtnNPPPD.get_active():
+                 ppd = cups.PPD(self.filechooserPPD.get_filename())
+-                ppd.localize ()
+             else:
+                 # PPD of the driver downloaded from OpenPrinting XXX
+                 treeview = self.tvNPDownloadableDrivers
+@@ -5132,7 +5141,6 @@ class NewPrinterGUI(GtkGUI):
+                             ppdfile.write(ppdcontent)
+                             ppdfile.close()
+                             ppd = cups.PPD(ppdname)
+-                            ppd.localize ()
+                             os.unlink(ppdname)
+ 
+         except RuntimeError, e:
+@@ -5188,7 +5196,6 @@ class NewPrinterGUI(GtkGUI):
+                 if (ppd != "raw"):
+                     f = self.mainapp.cups.getServerPPD(ppd)
+                     ppd = cups.PPD(f)
+-                    ppd.localize ()
+                     os.unlink(f)
+             except AttributeError:
+                 nonfatalException()
+@@ -5373,7 +5380,6 @@ class NewPrinterGUI(GtkGUI):
+                 try:
+                     filename = self.mainapp.cups.getPPD(name)
+                     ppd = cups.PPD(filename)
+-                    ppd.localize ()
+                     os.unlink(filename)
+                 except cups.IPPError, (e, msg):
+                     if e == cups.IPP_NOT_FOUND:
+diff --git a/troubleshoot/ErrorLogCheckpoint.py b/troubleshoot/ErrorLogCheckpoint.py
+index 99b00a9..26e862f 100644
+--- a/troubleshoot/ErrorLogCheckpoint.py
++++ b/troubleshoot/ErrorLogCheckpoint.py
+@@ -22,6 +22,7 @@
+ import cups
+ import os
+ import tempfile
++import time
+ from base import *
+ class ErrorLogCheckpoint(Question):
+     def __init__ (self, troubleshooter):
+@@ -157,10 +158,10 @@ class ErrorLogCheckpoint(Question):
+             prev_debug = 0
+         try:
+             prev_logsize = int (settings[MAXLOGSIZE])
+-        except KeyError:
++        except (KeyError, ValueError):
+             prev_logsize = -1
+ 
+-        if prev_debug == 0 or prev_logsize != 0:
++        if prev_debug == 0 or prev_logsize != '0':
+             settings[cups.CUPS_SERVER_DEBUG_LOGGING] = '1'
+             settings[MAXLOGSIZE] = '0'
+             success = False
+@@ -168,6 +169,17 @@ class ErrorLogCheckpoint(Question):
+                 debugprint ("Settings to set: " + repr (settings))
+                 c.adminSetServerSettings (settings)
+                 success = True
++
++                # Now reconnect.
++                attempt = 1
++                while attempt <= 5:
++                    try:
++                        time.sleep (1)
++                        c._connect ()
++                        break
++                    except RuntimeError:
++                        # Connection failed
++                        attempt += 1
+             except cups.IPPError:
+                 pass
+             except RuntimeError:
+diff --git a/troubleshoot/ErrorLogFetch.py b/troubleshoot/ErrorLogFetch.py
+index 7dd97f3..4d92602 100644
+--- a/troubleshoot/ErrorLogFetch.py
++++ b/troubleshoot/ErrorLogFetch.py
+@@ -22,6 +22,7 @@
+ import cups
+ import os
+ import tempfile
++import time
+ from base import *
+ class ErrorLogFetch(Question):
+     def __init__ (self, troubleshooter):
+@@ -114,6 +115,17 @@ class ErrorLogFetch(Question):
+         try:
+             c.adminSetServerSettings (settings)
+             success = True
++
++            # Now reconnect.
++            attempt = 1
++            while attempt <= 5:
++                try:
++                    time.sleep (1)
++                    c._connect ()
++                    break
++                except RuntimeError:
++                    # Connection failed
++                    attempt += 1
+         except cups.IPPError:
+             pass
+ 


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -r1.232 -r1.233
--- system-config-printer.spec	5 Dec 2008 12:44:18 -0000	1.232
+++ system-config-printer.spec	12 Dec 2008 10:04:55 -0000	1.233
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.0.12
-Release: 1%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -15,6 +15,8 @@
 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
 
+Patch0: system-config-printer-1.0.x.patch
+
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
 BuildRequires: libsmbclient-devel >= 3.2
@@ -60,6 +62,7 @@
 
 %prep
 %setup -q -a 1 -a 2
+%patch0 -p1 -b .1.0.x
 
 %build
 %configure
@@ -149,16 +152,26 @@
 exit 0
 
 %changelog
+* Fri Dec 12 2008 Tim Waugh <twaugh at redhat.com> 1.0.12-4
+- Updated patch for 1.0.x changes:
+  - Fix for advanced server settings dialog.
+  - Fixes for troubleshooter to restore error_log fetching.
+
+* Wed Dec 10 2008 Tim Waugh <twaugh at redhat.com> 1.0.12-3
+- Updated patch for 1.0.x changes:
+  - Fixed problem that prevented authentication prompt being
+    displayed.
+
+* Fri Dec  5 2008 Tim Waugh <twaugh at redhat.com> 1.0.12-2
+- Added patch for 1.0.x changes since 1.0.12:
+  - Smarter PPD cache in cupshelpers module.
+  - Don't write back localized versions of globalized PPDs.
+
 * Mon Dec  1 2008 Tim Waugh <twaugh at redhat.com> 1.0.12-1
 - Updated to 1.0.12:
   - Don't automatically replace network printer URIs with
     HPLIP URIs (bug #473129).
   - Fixed some file descriptor and temporary file leaks.
-
-* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm at gmail.com> - 1.0.11-3
-- Rebuild for Python 2.6
-
-* Fri Nov 28 2008 Tim Waugh <twaugh at redhat.com> 1.0.11-2
 - Updated pycups to 1.9.44.
 
 * Fri Nov 21 2008 Tim Waugh <twaugh at redhat.com> 1.0.11-1




More information about the fedora-extras-commits mailing list