diff options
author | Tim Potter <tpot@samba.org> | 2002-09-06 07:34:57 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-09-06 07:34:57 +0000 |
commit | a2327b84858453ff250b7635f423ae94edf2740b (patch) | |
tree | 4c545999f4662923dfd0045355585b8533e64393 /source3/python/gprinterdata | |
parent | e411dc9687d84dae9e01c57a37ce1bc4b8c71a10 (diff) | |
download | samba-a2327b84858453ff250b7635f423ae94edf2740b.tar.gz samba-a2327b84858453ff250b7635f423ae94edf2740b.tar.bz2 samba-a2327b84858453ff250b7635f423ae94edf2740b.zip |
Move printerdata dictionary object into it's own file.
(This used to be commit c211d2deca1019d3ef9bd08f5a01e76ede2d0191)
Diffstat (limited to 'source3/python/gprinterdata')
-rwxr-xr-x | source3/python/gprinterdata | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source3/python/gprinterdata b/source3/python/gprinterdata index 52c6e42719..f1992db5a5 100755 --- a/source3/python/gprinterdata +++ b/source3/python/gprinterdata @@ -5,18 +5,8 @@ from gtkdictbrowser import GtkDictBrowser, hex_string import gtk import spoolss import string +import printerdata -class printerdata: - def __init__(self, host): - host = string.replace(host, "/", "\\") - self.hnd = spoolss.openprinter(host) - - def keys(self): - return self.hnd.enumprinterdata().keys() - - def __getitem__(self, key): - return self.hnd.getprinterdata(key)['data'] - # Initialise printerdata dictionary if len(sys.argv) != 2: @@ -25,7 +15,8 @@ if len(sys.argv) != 2: sys.exit(1) try: - t = printerdata(sys.argv[1]) + host = string.replace(sys.argv[1], "/", "\\") + t = printerdata.printerdata(host) except: print "gprinterdata: error opening %s" % sys.argv[1] sys.exit(1) |