4
from gtkdictbrowser import GtkDictBrowser, hex_string
6
from samba import spoolss
10
# Initialise printerdata dictionary
12
if len(sys.argv) < 2 or len(sys.argv) > 3:
13
print "Usage: gprinterdata [--ex] <printer>"
14
print "where <printer> is a UNC printer name."
18
host = string.replace(sys.argv[len(sys.argv) - 1], "/", "\\")
19
if sys.argv[1] == "--ex":
20
t = printerdata.printerdata_ex(host)
22
t = printerdata.printerdata(host)
24
print "gprinterdata: error opening %s" % sys.argv[len(sys.argv) - 1]
29
db = GtkDictBrowser(t)
30
db.register_get_value_text_fn("", hex_string)
31
db.build_ui('gprinterdata')
33
# Override Python's handling of ctrl-c so we can break out of the
34
# gui from the command line.
37
signal.signal(signal.SIGINT, signal.SIG_DFL)