| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from model.flake.flake_try_job import FlakeTryJob | 7 from model.flake.flake_try_job import FlakeTryJob |
| 8 from model.base_try_job_data import BaseTryJobData | 8 from model.base_try_job_data import BaseTryJobData |
| 9 | 9 |
| 10 | 10 |
| 11 class FlakeTryJobData(BaseTryJobData): | 11 class FlakeTryJobData(BaseTryJobData): |
| 12 |
| 12 """Represents a flake try job's metadata.""" | 13 """Represents a flake try job's metadata.""" |
| 13 | 14 |
| 14 @ndb.ComputedProperty | 15 @ndb.ComputedProperty |
| 15 def master_name(self): | 16 def master_name(self): |
| 16 return FlakeTryJob.GetMasterName(self.try_job_key) | 17 return FlakeTryJob.GetMasterName(self.try_job_key) |
| 17 | 18 |
| 18 @ndb.ComputedProperty | 19 @ndb.ComputedProperty |
| 19 def builder_name(self): | 20 def builder_name(self): |
| 20 return FlakeTryJob.GetBuilderName(self.try_job_key) | 21 return FlakeTryJob.GetBuilderName(self.try_job_key) |
| 21 | 22 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 def _CreateKey(build_id): # pragma: no cover | 36 def _CreateKey(build_id): # pragma: no cover |
| 36 return ndb.Key('FlakeTryJobData', build_id) | 37 return ndb.Key('FlakeTryJobData', build_id) |
| 37 | 38 |
| 38 @staticmethod | 39 @staticmethod |
| 39 def Create(build_id): # pragma: no cover | 40 def Create(build_id): # pragma: no cover |
| 40 return FlakeTryJobData(key=FlakeTryJobData._CreateKey(build_id)) | 41 return FlakeTryJobData(key=FlakeTryJobData._CreateKey(build_id)) |
| 41 | 42 |
| 42 @staticmethod | 43 @staticmethod |
| 43 def Get(build_id): # pragma: no cover | 44 def Get(build_id): # pragma: no cover |
| 44 return FlakeTryJobData._CreateKey(build_id).get() | 45 return FlakeTryJobData._CreateKey(build_id).get() |
| OLD | NEW |