X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=tools%2Fdrawmodules.py;h=4926d8b8dc087d5b82f5af624b2168f9fe9d50b5;hb=61b2e2ea5cb50df90931acf3fcd840493ba762a9;hp=05a27c070e31c62482514bfeeaad1fd2a8b753e6;hpb=62e4ecafd13729e2e303011a8b5d3c3c00e01600;p=senf.git diff --git a/tools/drawmodules.py b/tools/drawmodules.py index 05a27c0..4926d8b 100755 --- a/tools/drawmodules.py +++ b/tools/drawmodules.py @@ -3,7 +3,7 @@ import sys COLOR_SCHEME = 'pastel19' # see http://www.graphviz.org/doc/info/colors.html - +NETEMU = ["InterfaceAnnotater" , "PacketMonitor" , "PacketTypeChecker"] mode = "MODULE" sys.stdout.write(""" @@ -48,12 +48,12 @@ for line in sys.stdin: for moduleid, (module, cs) in modules.iteritems(): module = module.split('<',1)[0] - if "senf" not in module.split('::',1)[0]: - color = 6 - elif "senf::ppi::module::ActiveSocketSource" in module: - color = 1 - elif "senf::ppi::module::PassiveSocketSink" in module: - color = 1 + if module.rsplit('::',1)[-1] in NETEMU or module.startswith("senf::emu"): + color = 5 + elif module.endswith("Source") or module.endswith("Sink"): + color = 1 + elif "senf" not in module.split('::',1)[0]: + color = 6 else: color = 3 module = module.rsplit('::',1)[-1] @@ -66,7 +66,8 @@ for moduleid, (module, cs) in modules.iteritems(): if inputs: rows.append("{%s}" % "|".join(inputs)) rows.append("%s (%s)" % (module, moduleid)) if outputs: rows.append("{%s}" % "|".join(outputs)) - sys.stdout.write('%s [label="{%s}" style="filled" fillcolor="/%s/%s" ]\n' % (moduleid, "|".join(rows), COLOR_SCHEME, color )) + sys.stdout.write('%s [label="{%s}" style="filled" fillcolor="/%s/%s" ]\n' + % (moduleid, "|".join(rows),COLOR_SCHEME, color )) anonid = 0 @@ -92,3 +93,4 @@ for moduleid, (type, cs) in modules.iteritems(): anonid += 1 sys.stdout.write("}\n") +