Chromium Code Reviews| Index: appengine/findit/model/base_try_job.py |
| diff --git a/appengine/findit/model/base_try_job.py b/appengine/findit/model/base_try_job.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66f112465fed04068577a589c391e12e691852de |
| --- /dev/null |
| +++ b/appengine/findit/model/base_try_job.py |
| @@ -0,0 +1,36 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
|
stgao
2016/12/16 23:41:05
2016
lijeffrey
2016/12/17 02:45:43
Done.
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from google.appengine.ext import ndb |
| + |
| +from model.base_build_model import BaseBuildModel |
| +from model import analysis_status |
| + |
| + |
| +class BaseTryJob(BaseBuildModel): |
| + """Represents a base try job result.""" |
| + |
| + # The status of the try job. |
| + status = ndb.IntegerProperty( |
| + default=analysis_status.PENDING, indexed=False) |
| + |
| + # A list of try job IDs associated with each try job for collecting metadata. |
| + try_job_ids = ndb.JsonProperty(indexed=False, compressed=True) |
| + |
| + @staticmethod |
| + def Create(*_): # pragma: no cover |
| + raise NotImplementedError('Create should be implemented in the child class') |
| + |
| + @staticmethod |
| + def Get(*_): # pragma: no cover |
| + 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
|
| + |
| + @property |
| + def completed(self): |
| + return self.status in ( |
| + analysis_status.COMPLETED, analysis_status.ERROR) |
| + |
| + @property |
| + def failed(self): |
| + return self.status == analysis_status.ERROR |