From: ssauer Date: Mon, 26 Jul 2010 11:55:00 +0000 (+0000) Subject: Changed drawmodules to highlight NetEmu modules X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=51d8103ad895651cd9e0a67a9e10e2e8d0ee5771 Changed drawmodules to highlight NetEmu modules git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1650 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/tools/drawmodules.py b/tools/drawmodules.py index 05a27c0..30709c7 100755 --- a/tools/drawmodules.py +++ b/tools/drawmodules.py @@ -3,7 +3,8 @@ import sys COLOR_SCHEME = 'pastel19' # see http://www.graphviz.org/doc/info/colors.html - +SOURCE_SINK = ["ActiveSocketSource", "PassiveSocketSource", "ActiveSocketSink", "PassiveSocketSink"] +NETEMU = ["InterfaceAnnotater" , "PacketMonitor" , "PacketTypeChecker"] mode = "MODULE" sys.stdout.write(""" @@ -49,11 +50,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: + color = 5 + else: + color = 6 + elif module.rsplit('::',1)[-1] in SOURCE_SINK: + color = 1 else: color = 3 module = module.rsplit('::',1)[-1] @@ -66,7 +68,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 +95,4 @@ for moduleid, (type, cs) in modules.iteritems(): anonid += 1 sys.stdout.write("}\n") +