diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-08-13 01:53:07 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-08-13 01:53:07 +0000 |
commit | ef2e26c91b80556af033d3335e55f5dfa6fff31d (patch) | |
tree | faa21bfd7e7b5247250b47c7891dc1a5ebee6be9 /source4/python/gprinterdata | |
download | samba-ef2e26c91b80556af033d3335e55f5dfa6fff31d.tar.gz samba-ef2e26c91b80556af033d3335e55f5dfa6fff31d.tar.bz2 samba-ef2e26c91b80556af033d3335e55f5dfa6fff31d.zip |
first public release of samba4 code
(This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f)
Diffstat (limited to 'source4/python/gprinterdata')
-rwxr-xr-x | source4/python/gprinterdata | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source4/python/gprinterdata b/source4/python/gprinterdata new file mode 100755 index 0000000000..cd062076c0 --- /dev/null +++ b/source4/python/gprinterdata @@ -0,0 +1,39 @@ +#!/usr/bin/env python + +import sys +from gtkdictbrowser import GtkDictBrowser, hex_string +import gtk +from samba import spoolss +import string +import printerdata + +# Initialise printerdata dictionary + +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[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[len(sys.argv) - 1] + sys.exit(1) + +# Create interface + +db = GtkDictBrowser(t) +db.register_get_value_text_fn("", hex_string) +db.build_ui('gprinterdata') + +# Override Python's handling of ctrl-c so we can break out of the +# gui from the command line. + +import signal +signal.signal(signal.SIGINT, signal.SIG_DFL) + +gtk.mainloop() |