summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorFelix Richter <github@syntax-fehler.de>2011-05-26 10:28:35 +0200
committerFelix Richter <github@syntax-fehler.de>2011-05-26 10:28:35 +0200
commit67b701652f280e041914685bfcd58d03f2a4468a (patch)
tree004db540183714a6825b3d4e0a7e8c95de886c75 /.scripts
parent3977b3d3e025aa52c27bc9856e96c13abc0d976c (diff)
changed weight-calculation for graphgen
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/adv_graphgen/parse.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/.scripts/adv_graphgen/parse.py b/.scripts/adv_graphgen/parse.py
index 27fe3a99..b0534d93 100755
--- a/.scripts/adv_graphgen/parse.py
+++ b/.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: