def populate_tree(self, master, parent, element,from_file=False):
        """Reads xml nodes and populates tree item"""

        data = WidgetDescr(None, None)
        data.from_xml_node(element)
        cname = data.get_class()
        uniqueid = self.get_unique_id(cname, data.get_id())
        data.set_property('id', uniqueid)

        if cname in builder.CLASS_MAP:
            pwidget = self._insert_item(master, data,from_file=from_file)
            xpath = "./child"
            children = element.findall(xpath)
            for child in children:
                child_object = child.find('./object')
                cwidget = self.populate_tree(pwidget, child, child_object,from_file=from_file)

            return pwidget
        else:
            raise Exception('Class "{0}" not mapped'.format(cname))
def populate_tree ( self , master , parent , element , from_file = False ) : data = WidgetDescr ( None , None ) data . from_xml_node ( element ) cname = data . get_class ( ) uniqueid = self . get_unique_id ( cname , data . get_id ( ) ) data . set_property ( 'id' , uniqueid ) if cname in builder . CLASS_MAP : pwidget = self . _insert_item ( master , data , from_file = from_file ) xpath = "./child" children = element . findall ( xpath ) for child in children : child_object = child . find ( './object' ) cwidget = self . populate_tree ( pwidget , child , child_object , from_file = from_file ) return pwidget else : raise Exception ( 'Class "{0}" not mapped' . format ( cname ) )
Reads xml nodes and populates tree item