Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: verification/base.py

Issue 6049007: Create IVerifierStatus and add IVerifierStatus.ignored(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: fix diff Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: verification/base.py
diff --git a/verification/base.py b/verification/base.py
index c797c130c6b95d4e4706e1d79be9cb589c510889..e9178f11084217b62b1965a68cb6436821ca6411 100644
--- a/verification/base.py
+++ b/verification/base.py
@@ -44,8 +44,36 @@ class Verified(model.PersistentMixIn):
return False
return any(v.failed() for v in self.verifications.itervalues())
+ def ignored(self):
+ """This item shouldn't be processed any further.
-class SimpleStatus(model.PersistentMixIn):
+ At least one verification step marked it as ignored.
+ """
+ if not self.verifications:
+ return False
+ return any(v.ignored() for v in self.verifications.itervalues())
+
+ def done(self):
+ """Processing on this item is done."""
+ return self.ignored() or self.succeeded() or self.failed()
+
+
+class IVerifierStatus(model.PersistentMixIn):
+ """Interface for objects in Verified.verifications dictionary."""
+ def succeeded(self):
+ raise NotImplementedError()
+
+ def failed(self):
+ raise NotImplementedError()
+
+ def ignored(self):
+ raise NotImplementedError()
+
+ def done(self):
+ return self.ignored() or self.succeeded() or self.failed()
+
+
+class SimpleStatus(IVerifierStatus):
"""Base class to be used for simple true/false verifiers."""
def __init__(self, state=None):
super(SimpleStatus, self).__init__()
@@ -57,6 +85,9 @@ class SimpleStatus(model.PersistentMixIn):
def failed(self):
return self.state is False
+ def ignored(self):
+ return False
+
class Verifier(object):
name = None
« pending_manager.py ('K') | « pending_manager.py ('k') | verification/try_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698