Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
router_label = fnc_router_metadata(global_dict, router_name, 'labelHtml', router_function, router_ckt_id, router_mode)
router_system = get_attribute(router_name,"system",global_dict)
G.add_node(router_name,label=router_name + "\n" + router_system, shape_fill=router_color)
for link in links.itertuples():
edgeLabel = link.cableID
G.add_edge(link.routerA,link.routerB, arrowhead='none',arrowfoot='none',label=edgeLabel)
print(filename)
G.write_graph(filename+'.graphml')
sys.exit(4)
elif router_mode in ['0']:
G = pyyed.Graph()
for router in routers:
# Variables
router_name = router[0][0]
router_function = get_attribute(router_name,"HWfunction",global_dict)
router_int = get_attribute(router_name,"Integrado",global_dict)
router_ckt_id = get_attribute(router_name,"ckt_id",global_dict)
router_color = get_attribute(router_name,"color",global_dict)['yEd']
router_label = fnc_router_metadata(global_dict, router_name, 'labelHtml', router_function, router_ckt_id, router_mode)
router_system = get_attribute(router_name,"system",global_dict)
grupo = G.add_group(router_name,label=router_name + "\n" + router_system, fill=router_color)
for port in router:
node_id = port[1]
def fnc_build_graphml(routers,edges,global_dict,router_mode,filename):
if router_mode in ['1','2','3','4']:
G = pyyed.Graph()
nodes = pd.DataFrame(routers)
nodes.columns=['router_name','port','label']
nodes = nodes[['router_name']]
nodes = nodes.drop_duplicates()
links = pd.DataFrame(edges)
links.columns=['routerA','routerB','cableID']
for router in nodes.itertuples():
router_name = router.router_name
router_function = get_attribute(router_name,"HWfunction",global_dict)
router_int = get_attribute(router_name,"Integrado",global_dict)
router_ckt_id = get_attribute(router_name,"ckt_id",global_dict)
router_color = get_attribute(router_name,"color",global_dict)['yEd']