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

Unified Diff: verification/base.py

Issue 11414143: Change models.py to use typed class members instead of a list of strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Address review comments Created 8 years, 1 month 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
« no previous file with comments | « tests/try_job_on_rietveld_test.py ('k') | verification/tree_status.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: verification/base.py
diff --git a/verification/base.py b/verification/base.py
index 4ca196580d32324412c1932e90816db39b0be136..7f2349eb045b5f717cb7d02667190fde49297835 100644
--- a/verification/base.py
+++ b/verification/base.py
@@ -28,13 +28,7 @@ class DiscardPending(Exception):
class Verified(model.PersistentMixIn):
"""A set of verifications that are for a specific patch."""
- persistent = [
- 'verifications',
- ]
-
- def __init__(self):
- super(Verified, self).__init__()
- self.verifications = {}
+ verifications = dict
def pending_name(self):
raise NotImplementedError()
@@ -73,13 +67,7 @@ class Verified(model.PersistentMixIn):
class IVerifierStatus(model.PersistentMixIn):
"""Interface for objects in Verified.verifications dictionary."""
- persistent = [
- 'error_message'
- ]
-
- def __init__(self, error_message=None):
- super(IVerifierStatus, self).__init__()
- self.error_message = error_message
+ error_message = (None, str)
def get_state(self):
"""See Verified.get_state()."""
@@ -92,13 +80,10 @@ class IVerifierStatus(model.PersistentMixIn):
class SimpleStatus(IVerifierStatus):
"""Base class to be used for simple true/false verifiers."""
- persistent = IVerifierStatus.persistent + [
- 'state',
- ]
+ state = int
- def __init__(self, state=PROCESSING, error_message=None):
- super(SimpleStatus, self).__init__(error_message)
- self.state = state
+ def __init__(self, state=PROCESSING, **kwargs):
+ super(SimpleStatus, self).__init__(state=state, **kwargs)
def get_state(self):
return self.state
« no previous file with comments | « tests/try_job_on_rietveld_test.py ('k') | verification/tree_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698