# HG changeset patch # User Thinker K.F. Li # Date 1302420513 -28800 # Node ID 43369f3314d8269ee4084d9b479f3c3a71ec5a88 # Parent 5b69baa49a8bc31906b364f486d27f54b9c462ed Fix the issue of loading components from SVG. - Users can not switch to components in the document that was loaded from previously saved SVG file. - Scribboo can not find components with names listed in the component list. - It is because that Scribboo is fault to use node name of ns0:component instead of 'name' attribute as component name. - It is fixed by using 'name' attribute of ns0:component node. diff -r 5b69baa49a8b -r 43369f3314d8 pyink/domview.py --- a/pyink/domview.py Sun Apr 10 12:07:26 2011 +0800 +++ b/pyink/domview.py Sun Apr 10 15:28:33 2011 +0800 @@ -278,9 +278,11 @@ comp_names = self._comp_names components_node = self._components_node for child in components_node.childList(): - child_name = child.name() - if child_name != 'ns0:component': + child_node_name = child.name() + if child_node_name != 'ns0:component': continue + + child_name = child.getAttribute('name') if child_name in comp_names: raise ValueError, 'duplicate component name %s' % (child_name) @@ -288,6 +290,7 @@ comp.parse_timelines() self._components.append(comp) + comp_names.add(child_name) pass pass