From 663aa10dc75870daab14f6ee06e6407576ac5bce Mon Sep 17 00:00:00 2001 From: ccremers Date: Wed, 9 Aug 2006 12:08:53 +0000 Subject: [PATCH] - Misc improved again. --- gui/Gui/Scytherthread.py | 2 +- gui/Scyther/Claim.py | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index 8bf6218..608141d 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -285,7 +285,7 @@ class ResultWindow(wx.Frame): views += self.BuildClaim(grid,claims[index],index+1) if views > 0: - titlebar(7,"View",1) + titlebar(7,"Classes",1) self.SetSizer(grid) self.Fit() diff --git a/gui/Scyther/Claim.py b/gui/Scyther/Claim.py index 43c4411..6c5fde6 100644 --- a/gui/Scyther/Claim.py +++ b/gui/Scyther/Claim.py @@ -4,6 +4,20 @@ import Term +def stateDescription(okay,n=1,caps=False): + if okay: + s = "trace class" + if n != 1: + s += "es" + else: + s = "attack" + if n != 1: + s += "s" + if caps: + s = s[0].upper() + s[1:] + return s + + class Claim(object): def __init__(self): self.id = None # a unique id string, consisting of 'protocol,label' @@ -55,13 +69,7 @@ class Claim(object): self.okay = (not self.okay) def stateName(self,count=1): - if self.state: - s = "state" - else: - s = "attack" - if count != 1: - s += "s" - return s + return stateDescription(self.state,count) def __str__(self): s = "claim id [%s]" % (self.id)