comparison pyink/domview.py @ 1290:99de83340782

Merge
author wycc
date Sat, 15 Jan 2011 21:19:50 +0800
parents fb44830c8a81 922d1caf6632
children 082fff7e9604
comparison
equal deleted inserted replaced
1289:e816b0c2deec 1290:99de83340782
730 # Duplicate children of a group, and append them to another group. 730 # Duplicate children of a group, and append them to another group.
731 # 731 #
732 def copy_group_children(self, src_group, dst_group): 732 def copy_group_children(self, src_group, dst_group):
733 # Search for the duplicated group 733 # Search for the duplicated group
734 doc = self._doc 734 doc = self._doc
735 735
736 dup_group = src_group.duplicate(doc) 736 dup_group = src_group.duplicate(doc)
737 737
738 old_nodes = _DOM_iterator(src_group) 738 old_nodes = _DOM_iterator(src_group)
739 new_nodes = _DOM_iterator(dup_group) 739 new_nodes = _DOM_iterator(dup_group)
740 new_gids = set() 740 new_gids = set()
755 gid = self.new_id() 755 gid = self.new_id()
756 pass 756 pass
757 new_gids.add(gid) 757 new_gids.add(gid)
758 new_node.setAttribute('id', gid) 758 new_node.setAttribute('id', gid)
759 pass 759 pass
760 760
761 for child in dup_group.childList(): 761 for child in dup_group.childList():
762 dup_group.removeChild(child) # prvent from crash 762 dup_group.removeChild(child) # prvent from crash
763 dst_group.appendChild(child) 763 dst_group.appendChild(child)
764 pass 764 pass
765 pass 765 pass