Exemple #1
0
 def __setitem__(self, key, value):
     self.current_dict.__setitem__(
         key, _convert_to_edit_object(value, self, key))
     self.append_edits(nup.Edit('set', [key], value))
Exemple #2
0
 def update(self, update_dict):
     for k, v in update_dict.items():
         self.current_dict.__setitem__(k,
                                       _convert_to_edit_object(v, self, k))
     self.append_edits(nup.Edit('update', [], update_dict))
Exemple #3
0
 def __delitem__(self, key):
     self.current_dict.__delitem__(key)
     self.append_edits(nup.Edit('del', [], key))
Exemple #4
0
 def insert(self, i, v):
     vc = _convert_to_edit_object(v, self, i)
     self.current_list.insert(i, vc)
     self.append_edits(nup.Edit('insert', [i], v))
Exemple #5
0
 def extend(self, other_list):
     for v in other_list:
         self.current_list.append(
             _convert_to_edit_object(v, self, len(self.current_list)))
     self.append_edits(nup.Edit('extend', [], other_list))
Exemple #6
0
 def append(self, value):
     self.current_list.append(
         _convert_to_edit_object(value, self, len(self.current_list)))
     self.append_edits(nup.Edit('append', [], value))
Exemple #7
0
 def __delitem__(self, o):
     self.current_list.__delitem__(o)
     self.append_edits(nup.Edit('del', [], o))