コード例 #1
0
    def get_links(self, rspec):
        links_ = []
        for l in rspec.findall(".//{%s}link" % (self.none)):
            manager_ = l.find("{%s}component_manager" % (self.none))
            if manager_ is None:
                self.raise_exception("Component-Mgr tag not found in link!")

            l_ = Link(l.attrib.get("client_id"), manager_.attrib.get("name"))

            [
                l_.add_interface_ref(i.attrib.get("client_id"))
                for i in l.iterfind("{%s}interface_ref" % (self.none))
            ]

            [
                l_.add_property(p.attrib.get("source_id"),
                                p.attrib.get("dest_id"),
                                p.attrib.get("capacity"))
                for p in l.iterfind("{%s}property" % (self.none))
            ]

            links_.append(l_.serialize())

        return links_