comparison pyink/domview.py @ 1285:e2d2532c3115

Replace a workaround with a more semantic one. - In old implementation, it has not clear intention in the syntax. - I move the line doing real works into the try-except block to emphasize the intention of skipping scene nodes that is incomplete.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 15 Jan 2011 18:32:33 +0800
parents cbcb91b196fa
children 922d1caf6632
comparison
equal deleted inserted replaced
1284:cbcb91b196fa 1285:e2d2532c3115
233 for scene_node in scenes_node.childList(): 233 for scene_node in scenes_node.childList():
234 if scene_node.name() != 'ns0:scene': 234 if scene_node.name() != 'ns0:scene':
235 continue 235 continue
236 236
237 try: 237 try:
238 ref = scene_node.getAttribute('ref')
239 start, end, scene_type = self.parse_one_scene(scene_node) 238 start, end, scene_type = self.parse_one_scene(scene_node)
240 except: 239 group_id = scene_node.getAttribute("ref")
240 except: # the scene node is incompleted.
241 continue 241 continue
242 242
243 group_id = scene_node.getAttribute("ref")
244 self._group2scene[group_id] = scene_node 243 self._group2scene[group_id] = scene_node
245 pass 244 pass
246 pass 245 pass
247 246
248 ## \brief Parse all scenes node in svg:metadata subtree. 247 ## \brief Parse all scenes node in svg:metadata subtree.