예제 #1
0
파일: transaction.py 프로젝트: LBdN/labs
 def do(self, rvalue):
     for c in rvalue.children[:]:
         tree.disconnect(c, rvalue)
     rvalue.naked_instance = self.new
     active_type = rvalue.rtype.get_active(self.new)
     vIndexes = b.wrap(active_type, self.new)
     for vIndex in vIndexes:
         tree.connect(vIndex, rvalue)
     #==
     if isinstance(rvalue.naked_instance, list):
         assert len(rvalue.children[0].children)==len(rvalue.naked_instance)
예제 #2
0
파일: transaction.py 프로젝트: LBdN/labs
 def do(self, rvalue):
     #==
     assert rvalue.rtype.is_multi_list()
     n        = len(rvalue.naked_instance)
     tIndex   = rvalue.rtype.children[0]
     vIndexes = b.wrap(tIndex, [self.new])
     rvalue.naked_instance.append(self.new) #modification in place
     for vIndex in vIndexes:
         vIndex.idx = vIndex.idx + n
         tree.connect(vIndex, rvalue)
     #==
     assert len(rvalue.children)==len(rvalue.naked_instance)
예제 #3
0
파일: transaction.py 프로젝트: LBdN/labs
 def do(self, rvalue):
     #==
     assert rvalue.rtype.is_multi_list()
     tIndex   = rvalue.rtype.children[0]
     idx, val = self.new
     vIndexes = b.wrap(tIndex, [val])
     rvalue.naked_instance.insert(idx, val) #modification in place
     assert len(vIndexes) == 1
     vIndex     = vIndexes[0]
     vIndex.idx = idx
     for c in rvalue.children[idx:]:
         c.idx += 1
     tree.connect(vIndex, rvalue)
     #==
     assert len(rvalue.children)==len(rvalue.naked_instance)