rpms/system-config-printer/F-11 system-config-printer-getdevices.patch, NONE, 1.1 system-config-printer.spec, 1.272, 1.273

Tim Waugh twaugh at fedoraproject.org
Mon Aug 10 21:29:16 UTC 2009


Author: twaugh

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

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-getdevices.patch 
Log Message:
* Mon Aug 10 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-2
- Added patch for cupspk DevicesGet method call.


system-config-printer-getdevices.patch:
 cupspk.py |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

--- NEW FILE system-config-printer-getdevices.patch ---
diff -up system-config-printer-1.1.11/cupspk.py.getdevices system-config-printer-1.1.11/cupspk.py
--- system-config-printer-1.1.11/cupspk.py.getdevices	2009-08-05 11:33:24.000000000 +0100
+++ system-config-printer-1.1.11/cupspk.py	2009-08-07 18:05:45.528421465 +0100
@@ -300,7 +300,53 @@ class Connection:
 #    getPPDs
 #    getServerPPD
 #    getDocument
-#    getDevices
+
+
+    def getDevices(self, *args, **kwds):
+        use_pycups = False
+        pk_args = ()
+
+        result = self._call_with_pk_and_fallback(use_pycups,
+                                                 'DevicesGet', pk_args,
+                                                 self._connection.getDevices,
+                                                 *args, **kwds)
+
+        result_str = {}
+        if result != None:
+            for i in result.keys():
+                if type(i) == dbus.String:
+                    result_str[str(i)] = str(result[i])
+                else:
+                    result_str[i] = result[i]
+
+        # cups-pk-helper returns all devices in one dictionary.
+        # Keys of different devices are distinguished by ':n' postfix.
+
+        devices = {}
+        n = 0
+        postfix = ':' + str (n)
+        device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
+        while len (device_keys) > 0:
+
+            device_uri = None
+            device_dict = {}
+            for i in device_keys:
+                key = i[:len(i)-len(postfix)]
+                if key != 'device-uri':
+                    device_dict[key] = result_str[i]
+                else:
+                    device_uri = result_str[i]
+
+            if device_uri != None:
+                devices[device_uri] = device_dict
+
+            n += 1
+            postfix = ':' + str (n)
+            device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
+
+        return devices
+
+
 #    getJobs
 #    getJobAttributes
 


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-11/system-config-printer.spec,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -p -r1.272 -r1.273
--- system-config-printer.spec	7 Aug 2009 17:26:31 -0000	1.272
+++ system-config-printer.spec	10 Aug 2009 21:29:16 -0000	1.273
@@ -7,13 +7,14 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.11
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
 Source0: http://cyberelk.net/tim/data/system-config-printer/1.1/system-config-printer-%{version}.tar.xz
 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
+Patch1: system-config-printer-getdevices.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -62,6 +63,7 @@ the configuration tool.
 
 %prep
 %setup -q -a 1 -a 2
+%patch1 -p1 -b .getdevices
 
 %build
 %configure
@@ -164,6 +166,9 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Mon Aug 10 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-2
+- Added patch for cupspk DevicesGet method call.
+
 * Fri Aug  7 2009 Tim Waugh <twaugh at redhat.com> 1.1.11-1
 - 1.1.11:
   - Several udev-configure-printer fixes.




More information about the fedora-extras-commits mailing list