changeset 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
files pyink/domview.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/domview.py	Sat Jan 15 02:43:20 2011 +0800
+++ b/pyink/domview.py	Sat Jan 15 18:32:33 2011 +0800
@@ -235,12 +235,11 @@
 		continue
 
 	    try:
-	    	ref = scene_node.getAttribute('ref')
 		start, end, scene_type = self.parse_one_scene(scene_node)
-	    except:
+                group_id = scene_node.getAttribute("ref")
+	    except:             # the scene node is incompleted.
 		continue
 	    
-	    group_id = scene_node.getAttribute("ref")
 	    self._group2scene[group_id] = scene_node
 	    pass
 	pass