def __setitem__(self, key, value): "Set key value-pair in dictionary" if key in self._valid_keys: return TransformedDict.__setitem__(self, key, value) else: raise Exception("Error: Invalid peer attribute '{}'.".format(key))
def __delitem__(self, key): "Reset key's value." if key in self._valid_keys: # Delete the item TransformedDict.__delitem__(self, key) # Re-create key with no value TransformedDict.__setitem__(self, key, None) else: # Delete unauth key TransformedDict.__delitem__(self, key)
def __getitem__(self, key): "Get value from dictionary." # Get item return TransformedDict.__getitem__(self, key)
def __dict__(self): "Return dictionary obj" return TransformedDict.__dict__()
def __repr__(self): "Object representation as string." return "Store({})".format(TransformedDict.__repr__(self))
def __str__(self): "String equivalent." return TransformedDict.__str__(self)