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 | c201a61a52ffbaf1b1b70e25e0ef2b29a89f921c (patch) | |
tree | 576d76131686f54afa4deeca038fa8418cfb717e /source/python/samba | |
parent | c211d2deca1019d3ef9bd08f5a01e76ede2d0191 (diff) | |
download | samba-c201a61a52ffbaf1b1b70e25e0ef2b29a89f921c.tar.gz samba-c201a61a52ffbaf1b1b70e25e0ef2b29a89f921c.tar.xz samba-c201a61a52ffbaf1b1b70e25e0ef2b29a89f921c.zip |
Initial version of printerdata_ex browsing.
Diffstat (limited to 'source/python/samba')
-rw-r--r-- | source/python/samba/printerdata.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/python/samba/printerdata.py b/source/python/samba/printerdata.py index 55b5fdf6ae7..3384de4f30b 100644 --- a/source/python/samba/printerdata.py +++ b/source/python/samba/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}) + |