From 6473aba398af03a9cc43d79c6439f129292256bd Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Thu, 20 Jun 2013 10:32:16 +0200 Subject: [PATCH] Misc: improving output of generate-attack-graphs.py script. --- gui/generate-attack-graphs.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gui/generate-attack-graphs.py b/gui/generate-attack-graphs.py index 575ee11..ad8ec50 100755 --- a/gui/generate-attack-graphs.py +++ b/gui/generate-attack-graphs.py @@ -78,7 +78,7 @@ def render_dot(fn,gtype): base_name = base_name[:i] cmd = ["dot","-T" + gtype,"-o%s.%s" % (base_name,gtype),fn] - print cmd + #print cmd call(cmd) @@ -96,10 +96,11 @@ def render_best_attack(fn,cid): pref = create_file_prefix(fn,cid) for cl in x.claims: + cln = cl.claimtype + if cln == "Commit": + cln = "Data_agree" + if len(cl.attacks) > 0: - cln = cl.claimtype - if cln == "Commit": - cln = "Data_agree" dotfile = "attack-%s-%s.dot" % (pref,cln) fp = open(dotfile,'w') fp.write(cl.attacks[-1].scytherDot) @@ -108,6 +109,8 @@ def render_best_attack(fn,cid): render_dot(dotfile,"png") render_dot(dotfile,"pdf") + print "%s; %s" % (fn,cl) + def main(): filelist = sys.argv[1:] @@ -116,7 +119,6 @@ def main(): for fn in set(cl): for cid in cl[fn]: - print fn,cid render_best_attack(fn,cid)