diff --git a/gui/Scyther/Claim.py b/gui/Scyther/Claim.py index 432b7b1..4d241be 100644 --- a/gui/Scyther/Claim.py +++ b/gui/Scyther/Claim.py @@ -148,6 +148,11 @@ class Claim(object): remark = "Exactly %i %s" % (n,atxt) return remark + "." + def triplet(self): + """ + Return protocol,role,label triplet + """ + return (self.protocol, self.role, self.shortlabel) def __str__(self): """ diff --git a/gui/Scyther/Scyther.py b/gui/Scyther/Scyther.py index 5d1007d..3c8b551 100755 --- a/gui/Scyther/Scyther.py +++ b/gui/Scyther/Scyther.py @@ -17,6 +17,7 @@ import tempfile """ Import scyther components """ import XMLReader import Error +import Claim from Misc import * #--------------------------------------------------------------------------- @@ -309,17 +310,19 @@ class Scyther(object): else: return self.output - def verifyOne(self,claimid): + def verifyOne(self,cl): """ Verify just a single claim with an ID retrieved from the - procedure below, 'scanClaims' + procedure below, 'scanClaims', or a full claim object """ - return self.verify("--filter=%s" % claimid) + if isinstance(cl,Claim.Claim): + cl = cl.id + return self.verify("--filter=%s" % cl) def scanClaims(self): """ - Retrieve the list of claims in a format that can be passed to - --filter=X or 'verifyOne' later. + Retrieve the list of claims. Of each element (a claim), claim.id + can be passed to --filter=X or 'verifyOne' later. A result of 'None' means that some errors occurred. """ self.verify("--scan-claims") @@ -327,10 +330,7 @@ class Scyther(object): return None else: self.validxml = False # Signal that we should not interpret the output as XML - l = [] - for claim in self.claims: - l.append(claim.id) - return l + return self.claims def getClaim(self,claimid): if self.claims: