comparison pyink/domview.py @ 1274:a4d3838264dd

Make public APIs being public for domview
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 12 Jan 2011 21:20:06 +0800
parents ef1f16beef21
children 776b024ae8f9
comparison
equal deleted inserted replaced
1273:1d0474f2f6fa 1274:a4d3838264dd
185 for n in node.childList(): 185 for n in node.childList():
186 self._collect_node_ids_recursive(n) 186 self._collect_node_ids_recursive(n)
187 pass 187 pass
188 pass 188 pass
189 189
190 def _parse_one_scene(self, scene_node): 190 def parse_one_scene(self, scene_node):
191 assert scene_node.name() == 'ns0:scene' 191 assert scene_node.name() == 'ns0:scene'
192 192
193 start = int(scene_node.getAttribute("start")) 193 start = int(scene_node.getAttribute("start"))
194 try: 194 try:
195 end = int(scene_node.getAttribute("end")) 195 end = int(scene_node.getAttribute("end"))
219 for scene_node in scenes_node.childList(): 219 for scene_node in scenes_node.childList():
220 if scene_node.name() != 'ns0:scene': 220 if scene_node.name() != 'ns0:scene':
221 continue 221 continue
222 222
223 try: 223 try:
224 start, end, scene_type = self._parse_one_scene(scene_node) 224 start, end, scene_type = self.parse_one_scene(scene_node)
225 except: 225 except:
226 continue 226 continue
227 227
228 group_id = scene_node.getAttribute("ref") 228 group_id = scene_node.getAttribute("ref")
229 self._group2scene[group_id] = scene_node 229 self._group2scene[group_id] = scene_node
657 return -1 657 return -1
658 658
659 def insert_frames(self, layer_idx, frame_idx, num): 659 def insert_frames(self, layer_idx, frame_idx, num):
660 layer = self._layers[layer_idx] 660 layer = self._layers[layer_idx]
661 for scene_node in layer.scenes: 661 for scene_node in layer.scenes:
662 start, end, tween_type = self._parse_one_scene(scene_node) 662 start, end, tween_type = self.parse_one_scene(scene_node)
663 if start >= frame_idx: 663 if start >= frame_idx:
664 self.chg_scene_node(scene_node, start=(start + num)) 664 self.chg_scene_node(scene_node, start=(start + num))
665 pass 665 pass
666 if end >= frame_idx: 666 if end >= frame_idx:
667 self.chg_scene_node(scene_node, end=(end + num)) 667 self.chg_scene_node(scene_node, end=(end + num))
684 layer = self._layers[layer_idx] 684 layer = self._layers[layer_idx]
685 685
686 last_rm = frame_idx + num - 1 # last removed frame 686 last_rm = frame_idx + num - 1 # last removed frame
687 for scene_node in layer.scenes: 687 for scene_node in layer.scenes:
688 start, end, tween_type = \ 688 start, end, tween_type = \
689 self._parse_one_scene(scene_node) 689 self.parse_one_scene(scene_node)
690 690
691 if end < frame_idx: 691 if end < frame_idx:
692 continue 692 continue
693 693
694 if start > last_rm: # this scene is at right side 694 if start > last_rm: # this scene is at right side