summaryrefslogtreecommitdiff
path: root/source3/python/gprinterdata
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-09-06 07:44:21 +0000
committerTim Potter <tpot@samba.org>2002-09-06 07:44:21 +0000
commitc9101c3b01b7a493944b1fec8612289d8dc531e7 (patch)
tree6eb0f63db244ed175fcf224f747e8074bf977cd1 /source3/python/gprinterdata
parenta2327b84858453ff250b7635f423ae94edf2740b (diff)
downloadsamba-c9101c3b01b7a493944b1fec8612289d8dc531e7.tar.gz
samba-c9101c3b01b7a493944b1fec8612289d8dc531e7.tar.bz2
samba-c9101c3b01b7a493944b1fec8612289d8dc531e7.zip
Initial version of printerdata_ex browsing.
(This used to be commit c201a61a52ffbaf1b1b70e25e0ef2b29a89f921c)
Diffstat (limited to 'source3/python/gprinterdata')
-rwxr-xr-xsource3/python/gprinterdata13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/python/gprinterdata b/source3/python/gprinterdata
index f1992db5a5..59c5f3c315 100755
--- a/source3/python/gprinterdata
+++ b/source3/python/gprinterdata
@@ -9,16 +9,19 @@ import printerdata
# Initialise printerdata dictionary
-if len(sys.argv) != 2:
- print "Usage: gprinterdata <printer>"
+if len(sys.argv) < 2 or len(sys.argv) > 3:
+ print "Usage: gprinterdata [--ex] <printer>"
print "where <printer> is a UNC printer name."
sys.exit(1)
try:
- host = string.replace(sys.argv[1], "/", "\\")
- t = printerdata.printerdata(host)
+ host = string.replace(sys.argv[len(sys.argv) - 1], "/", "\\")
+ if sys.argv[1] == "--ex":
+ t = printerdata.printerdata_ex(host)
+ else:
+ t = printerdata.printerdata(host)
except:
- print "gprinterdata: error opening %s" % sys.argv[1]
+ print "gprinterdata: error opening %s" % sys.argv[len(sys.argv) - 1]
sys.exit(1)
# Create interface