- Some improvements in interpretation of claim ranks
This commit is contained in:
parent
f8400ac02f
commit
f9ece7d497
@ -395,11 +395,15 @@ class ResultWindow(wx.Frame):
|
|||||||
grid.Add(bmpfield,(ypos,xpos),(1,1),wx.ALIGN_CENTER_VERTICAL|wx.ALL,10)
|
grid.Add(bmpfield,(ypos,xpos),(1,1),wx.ALIGN_CENTER_VERTICAL|wx.ALL,10)
|
||||||
else:
|
else:
|
||||||
# new style text control Ok/Fail
|
# new style text control Ok/Fail
|
||||||
txt = wx.StaticText(self,-1,cl.getOkay())
|
rank = cl.getRank()
|
||||||
|
rankt = [('Fail','red'),
|
||||||
|
('Fail','dark red'),
|
||||||
|
('Ok','dark green'),
|
||||||
|
('Ok','forest green')]
|
||||||
|
txt = wx.StaticText(self,-1,rankt[rank][0])
|
||||||
font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)
|
font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)
|
||||||
txt.SetFont(font)
|
txt.SetFont(font)
|
||||||
rankcolours = ['dark red','red','dark green','forest green']
|
txt.SetForegroundColour(rankt[rank][1])
|
||||||
txt.SetForegroundColour(rankcolours[cl.getRank()])
|
|
||||||
grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10)
|
grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10)
|
||||||
xpos += 1
|
xpos += 1
|
||||||
|
|
||||||
|
@ -71,15 +71,6 @@ class Claim(object):
|
|||||||
def stateName(self,count=1,caps=False):
|
def stateName(self,count=1,caps=False):
|
||||||
return stateDescription(self.state,count,caps)
|
return stateDescription(self.state,count,caps)
|
||||||
|
|
||||||
def getOkay(self):
|
|
||||||
"""
|
|
||||||
returns "Ok" or "Fail"
|
|
||||||
"""
|
|
||||||
if self.okay:
|
|
||||||
return "Ok"
|
|
||||||
else:
|
|
||||||
return "Fail"
|
|
||||||
|
|
||||||
def getRank(self):
|
def getRank(self):
|
||||||
"""
|
"""
|
||||||
Return claim rank
|
Return claim rank
|
||||||
@ -88,15 +79,16 @@ class Claim(object):
|
|||||||
2 - probably okay
|
2 - probably okay
|
||||||
3 - really okay
|
3 - really okay
|
||||||
"""
|
"""
|
||||||
|
n = len(self.attacks)
|
||||||
if not self.okay:
|
if not self.okay:
|
||||||
# not okay
|
# not okay
|
||||||
if self.complete:
|
if (self.state and self.complete) or ((not self.state) and (n > 0)):
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
# okay!
|
# okay!
|
||||||
if not self.complete:
|
if not ((self.state and (n > 0)) or ((not self.state) and self.complete)):
|
||||||
return 2
|
return 2
|
||||||
else:
|
else:
|
||||||
return 3
|
return 3
|
||||||
@ -129,8 +121,9 @@ class Claim(object):
|
|||||||
"""
|
"""
|
||||||
returns an element of [None,'Verified','Falsified']
|
returns an element of [None,'Verified','Falsified']
|
||||||
"""
|
"""
|
||||||
rl = ['Falsified',None,None,'Verified']
|
opts = ['Falsified',None,None,'Verified']
|
||||||
return rl[self.getRank()]
|
return opts[self.getRank()]
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
@ -141,11 +134,7 @@ class Claim(object):
|
|||||||
s+= " %s" % self.parameter
|
s+= " %s" % self.parameter
|
||||||
|
|
||||||
# determine status
|
# determine status
|
||||||
s+= " : %s status : %i %s" % (self.getOkay(),self.failed,self.stateName(self.failed))
|
s+= "\t: %s" % self.getComment()
|
||||||
vt = self.getVerified()
|
|
||||||
if vt:
|
|
||||||
s+= ", and thus the claim is %s" % vt
|
|
||||||
s+= ". %s" % self.getComment()
|
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user