diff options
author | Tim Potter <tpot@samba.org> | 2002-09-06 07:44:21 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-09-06 07:44:21 +0000 |
commit | c9101c3b01b7a493944b1fec8612289d8dc531e7 (patch) | |
tree | 6eb0f63db244ed175fcf224f747e8074bf977cd1 /source3/python/printerdata.py | |
parent | a2327b84858453ff250b7635f423ae94edf2740b (diff) | |
download | samba-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/printerdata.py')
-rw-r--r-- | source3/python/printerdata.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/python/printerdata.py b/source3/python/printerdata.py index 55b5fdf6ae..3384de4f30 100644 --- a/source3/python/printerdata.py +++ b/source3/python/printerdata.py @@ -21,3 +21,18 @@ class printerdata: self.hnd.setprinterdata({"key": "", "value": key, "type": 3, "data": value}) +class printerdata_ex: + def __init__(self, host, creds = {}): + self.hnd = spoolss.openprinter(host, creds = creds) + + def keys(self): + return self.hnd.enumprinterdataex("PrinterDriverData").keys() + + def __getitem__(self, key): + return self.hnd.getprinterdataex("PrinterDriverData", key)['data'] + + def __setitem__(self, key, value): + # Store as REG_BINARY for now + self.hnd.setprinterdataex({"key": "PrinterDriverData", "value": key, "type": 3, + "data": value}) + |