Example #1
0
 def delete_edge(self, edge: CanvasEdge) -> None:
     edge.delete()
     del self.edges[edge.token]
     src_node = self.nodes[edge.src]
     src_node.edges.discard(edge)
     if edge.src_iface:
         del src_node.ifaces[edge.src_iface.id]
     dst_node = self.nodes[edge.dst]
     dst_node.edges.discard(edge)
     if edge.dst_iface:
         del dst_node.ifaces[edge.dst_iface.id]
     src_wireless = NodeUtils.is_wireless_node(src_node.core_node.type)
     if src_wireless:
         dst_node.delete_antenna()
     dst_wireless = NodeUtils.is_wireless_node(dst_node.core_node.type)
     if dst_wireless:
         src_node.delete_antenna()
     self.core.deleted_canvas_edges([edge])
Example #2
0
 def click_unlink(self, edge: CanvasEdge) -> None:
     edge.delete()
     self.app.default_info()