2 # A python module that maps printerdata to a dictionary. We define
3 # two classes. The printerdata class maps to Get/Set/Enum/DeletePrinterData
4 # and the printerdata_ex class maps to Get/Set/Enum/DeletePrinterDataEx
10 def __init__(self, host, creds = {}):
11 self.hnd = spoolss.openprinter(host, creds = creds)
14 return self.hnd.enumprinterdata().keys()
16 def __getitem__(self, key):
17 return self.hnd.getprinterdata(key)['data']
19 def __setitem__(self, key, value):
20 # Store as REG_BINARY for now
21 self.hnd.setprinterdata({"key": "", "value": key, "type": 3,