Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
|
stgao
2016/12/16 23:41:05
2016
lijeffrey
2016/12/17 02:45:43
Done.
| |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from google.appengine.ext import ndb | |
| 6 | |
| 7 from model.base_build_model import BaseBuildModel | |
| 8 from model import analysis_status | |
| 9 | |
| 10 | |
| 11 class BaseTryJob(BaseBuildModel): | |
| 12 """Represents a base try job result.""" | |
| 13 | |
| 14 # The status of the try job. | |
| 15 status = ndb.IntegerProperty( | |
| 16 default=analysis_status.PENDING, indexed=False) | |
| 17 | |
| 18 # A list of try job IDs associated with each try job for collecting metadata. | |
| 19 try_job_ids = ndb.JsonProperty(indexed=False, compressed=True) | |
| 20 | |
| 21 @staticmethod | |
| 22 def Create(*_): # pragma: no cover | |
| 23 raise NotImplementedError('Create should be implemented in the child class') | |
| 24 | |
| 25 @staticmethod | |
| 26 def Get(*_): # pragma: no cover | |
| 27 raise NotImplementedError('Get should be implemented in the child class') | |
|
stgao
2016/12/16 23:41:05
Why these two methods are needed in the base class
lijeffrey
2016/12/17 02:45:43
Removed
| |
| 28 | |
| 29 @property | |
| 30 def completed(self): | |
| 31 return self.status in ( | |
| 32 analysis_status.COMPLETED, analysis_status.ERROR) | |
| 33 | |
| 34 @property | |
| 35 def failed(self): | |
| 36 return self.status == analysis_status.ERROR | |
| OLD | NEW |