- Updated cupspk DevicesGet call for accepted API.

This commit is contained in:
Tim Waugh 2009-08-13 16:40:49 +00:00
parent b35ea25ec2
commit f5f3846376
2 changed files with 29 additions and 5 deletions

View File

@ -1,7 +1,7 @@
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:
+++ system-config-printer-1.1.11/cupspk.py 2009-08-13 17:39:34.251284301 +0100
@@ -300,7 +300,74 @@ class Connection:
# getPPDs
# getServerPPD
# getDocument
@ -10,13 +10,34 @@ diff -up system-config-printer-1.1.11/cupspk.py.getdevices system-config-printer
+
+ def getDevices(self, *args, **kwds):
+ use_pycups = False
+ pk_args = ()
+
+ timeout = 0
+ include_schemes = ''
+ exclude_schemes = ''
+
+ if len(args) == 3:
+ (use_pycups, timeout, include_schemes, exclude_schemes) = self._args_to_tuple([int, str, str], *args)
+ else:
+ if kwds.has_key('timeout'):
+ timeout = kwds['timeout']
+
+ if kwds.has_key('include_schemes'):
+ include_schemes = kwds['include_schemes']
+
+ if kwds.has_key('exclude_schemes'):
+ exclude_schemes = kwds['exclude_schemes']
+
+ pk_args = (timeout, include_schemes, exclude_schemes)
+
+ result = self._call_with_pk_and_fallback(use_pycups,
+ 'DevicesGet', pk_args,
+ self._connection.getDevices,
+ *args, **kwds)
+
+ # return 'result' if fallback was called
+ if len (result.keys()) > 0 and type (result[result.keys()[0]]) == dict:
+ return result
+
+ result_str = {}
+ if result != None:
+ for i in result.keys():

View File

@ -7,7 +7,7 @@
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
@ -183,6 +183,9 @@ rm -rf %buildroot
exit 0
%changelog
* Thu Aug 13 2009 Tim Waugh <twaugh@redhat.com> 1.1.11-2
- Updated cupspk DevicesGet call for accepted API.
* Fri Aug 7 2009 Tim Waugh <twaugh@redhat.com> 1.1.11-1
- 1.1.11:
- Several udev-configure-printer fixes.