diff options
author | Tim Potter <tpot@samba.org> | 2002-09-19 00:26:07 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-09-19 00:26:07 +0000 |
commit | d3a661453e5e16cf0bd3bdcdb9b07d9f29ae0044 (patch) | |
tree | 61ac35dafbad9be9d454a6f296f780e0d21096a0 | |
parent | 15fdb18dd7f7169be9f22b639a6e1e9bcab833b9 (diff) | |
download | samba-d3a661453e5e16cf0bd3bdcdb9b07d9f29ae0044.tar.gz samba-d3a661453e5e16cf0bd3bdcdb9b07d9f29ae0044.tar.bz2 samba-d3a661453e5e16cf0bd3bdcdb9b07d9f29ae0044.zip |
Moving to subdirectory.
(This used to be commit 154c59c8f92b9f735f4e1e7c8c42692c959996f1)
-rw-r--r-- | source3/python/printerdata.py | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/source3/python/printerdata.py b/source3/python/printerdata.py deleted file mode 100644 index 33251f6a00..0000000000 --- a/source3/python/printerdata.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python - -# -# A python module that maps printerdata to a dictionary. We define -# two classes. The printerdata class maps to Get/Set/Enum/DeletePrinterData -# and the printerdata_ex class maps to Get/Set/Enum/DeletePrinterDataEx -# - -# -# TODO: -# -# - Implement __delitem__ -# - -from samba import spoolss - -class printerdata: - def __init__(self, host, creds = {}): - self.hnd = spoolss.openprinter(host, creds = creds) - - def keys(self): - return self.hnd.enumprinterdata().keys() - - def __getitem__(self, key): - return self.hnd.getprinterdata(key)['data'] - - def __setitem__(self, key, value): - # Store as REG_BINARY for now - self.hnd.setprinterdata({"key": "", "value": key, "type": 3, - "data": value}) - -class printerdata_ex: - def __init__(self, host): - self.host = host - self.top_level_keys = ["PrinterDriverData", "DsSpooler", "DsDriver", - "DsUser"] - - def keys(self): - return self.top_level_keys - - def has_key(self, key): - for k in self.top_level_keys: - if k == key: - return 1 - return 0 - - class printerdata_ex_subkey: - def __init__(self, host, key): - self.hnd = spoolss.openprinter(host) - self.key = key - - def keys(self): - return self.hnd.enumprinterdataex(self.key).keys() - - def __getitem__(self, key): - return self.hnd.getprinterdataex(self.key, key)['data'] - - def __getitem__(self, key): - return self.printerdata_ex_subkey(self.host, key) |