Skip to content

Commit

Permalink
Add a __set__ function to UdfDictionaryDescriptor to address SciLifeL…
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Feb 17, 2017
1 parent d25823d commit a69e8cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions genologics/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ def __get__(self, instance, cls):
self.value = UdfDictionary(instance, *self.rootkeys, udt=self._UDT)
return self.value

def __set__(self, instance, dict_value):
instance.get()
udf_dict = UdfDictionary(instance, *self.rootkeys, udt=self._UDT)
for k in dict_value:
udf_dict[k] = dict_value[k]


class UdtDictionaryDescriptor(UdfDictionaryDescriptor):
"""An instance attribute containing a dictionary of UDF values
Expand Down

0 comments on commit a69e8cd

Please sign in to comment.