From f7bc1f56d7824e73b324dbe9db5d209c12d97af1 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 26 May 2011 10:28:35 +0200 Subject: changed weight-calculation for graphgen --- retiolum/hosts/.scripts/adv_graphgen/parse.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'retiolum/hosts') diff --git a/retiolum/hosts/.scripts/adv_graphgen/parse.py b/retiolum/hosts/.scripts/adv_graphgen/parse.py index 27fe3a99..b0534d93 100755 --- a/retiolum/hosts/.scripts/adv_graphgen/parse.py +++ b/retiolum/hosts/.scripts/adv_graphgen/parse.py @@ -35,7 +35,10 @@ def merge_edges(nodes): def write_node(k,v): - """ writes a single node and its edges """ + """ writes a single node and its edges + edges are weightet with the informations inside the nodes provided by + tinc + """ node = " "+k+"[label=\"" node += k+"\\l" node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" @@ -47,11 +50,12 @@ def write_node(k,v): node += "]" print (node) for con in v.get('to',[]): - edge = " "+k+ " -> " +con['name'] + "[weight="+str(10/float(con['weight'])) + edge = " "+k+ " -> " +con['name'] + "[weight="+str(float(con['weight'])) if con.get('bidirectional',False): edge += ",dir=both" edge += "]" print edge + def parse_input(): nodes={} for line in sys.stdin: -- cgit v1.2.3