# HG changeset patch # User Thinker K.F. Li # Date 1294034778 -28800 # Node ID 2f3d523a38714072fbd4bee9141e115e6479d914 # Parent 582d3410e546c5f22e217eb3ad2e4f612621a63f Parse all scenes when start handling a document diff -r 582d3410e546 -r 2f3d523a3871 pyink/MBScene.py --- a/pyink/MBScene.py Mon Jan 03 13:57:00 2011 +0800 +++ b/pyink/MBScene.py Mon Jan 03 14:06:18 2011 +0800 @@ -303,6 +303,7 @@ self._start_monitor() # start MBScene_dom_monitor self._init_metadata() + self._parse_all_scenes() pass def dumpattr(self, n): @@ -370,7 +371,26 @@ pass pass pass + + ## \brief Parse all scenes node in svg:metadata subtree. + # + def _parse_all_scenes(self): + root = self._root + for child in root.childList(): + if child.name() != 'svg:metadata': + continue + + metadata_node = child + for metachild in metadata_node.childList(): + if metachild.name() == 'ns0:scenes': + self._parse_one_scenes(metachild) + pass + pass + pass + pass + ## \brief Create a scenes node if not existed. + # def _init_metadata(self): for node in self._root.childList(): if node.name() == 'svg:metadata':