summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@novell.com>2008-11-13 16:53:18 +0100
committerVincent Untz <vuntz@novell.com>2008-11-13 16:53:18 +0100
commit02242c90fa69bea25b34b02da53ff31581b8d9be (patch)
tree3121363771a55b50b3880c7956f029cfbb4150a9
parent80c3074b891ec8015450775bc5bdff34fed7b06f (diff)
Add some code in the python test for accepting jobs.
-rwxr-xr-xsrc/test-cups-pk.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test-cups-pk.py b/src/test-cups-pk.py
index fd78133..901c7cf 100755
--- a/src/test-cups-pk.py
+++ b/src/test-cups-pk.py
@@ -83,6 +83,18 @@ def addprinter(cups_pk, printer_name, printer_uri, ppd_file, info, location):
else:
print 'ouch: %s' % error
+def acceptjobs(cups_pk, printer_name, enabled, reason):
+ error = cups_pk.PrinterSetAcceptJobs(printer_name, enabled, reason)
+
+ if not type(error) in [dbus.String, dbus.UTF8String]:
+ print 'unexpected return value'
+ return
+
+ if error == '':
+ print 'worked!'
+ else:
+ print 'ouch: %s' % error
+
def changeoption(cups_pk, printer_name, option, value):
error = cups_pk.PrinterAddOptionDefault(printer_name, option, value)
@@ -107,6 +119,7 @@ def main(args):
#removeprinter(cups_pk_interface, "MyPrinter")
addprinter(cups_pk_interface, "MyPrinter", "smb://really/cool", "HP/Business_Inkjet_2200-chp2200.ppd.gz", "This is my printer", "At home")
#changeoption(cups_pk_interface, "MyPrinter", "toto", "At home")
+ #acceptjobs(cups_pk_interface, "MyPrinter", True, "")
break
except dbus.exceptions.DBusException, e:
if handle_exception_with_auth(session_bus, e):