From aa69c1ee80fbf7f45d61861089daeb5828e91229 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 2 May 2002 05:23:38 +0000 Subject: Some examples using the spoolss python module. (This used to be commit 68b952561429e1d08a974e633bb9c2870c819c69) --- source3/python/examples/spoolss/changeid.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 source3/python/examples/spoolss/changeid.py (limited to 'source3/python/examples/spoolss/changeid.py') diff --git a/source3/python/examples/spoolss/changeid.py b/source3/python/examples/spoolss/changeid.py new file mode 100755 index 0000000000..b2345094ed --- /dev/null +++ b/source3/python/examples/spoolss/changeid.py @@ -0,0 +1,29 @@ +#!/usr/bin/python +# +# Display the changeid for a list of printers given on the command line +# + +import sys, spoolss + +if len(sys.argv) == 1: + print "Usage: changeid.py " + sys.exit(1) + +for printer in sys.argv[1:]: + + # Open printer handle + + try: + hnd = spoolss.openprinter(printer) + except: + print "error opening printer %s" % printer + sys.exit(1) + + # Fetch and display changeid + + info = hnd.getprinter(level = 0) + print info["change_id"] + + # Clean up + + spoolss.closeprinter(hnd) -- cgit