| 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 datetime import datetime | 5 from datetime import datetime |
| 6 from datetime import time | 6 from datetime import time |
| 7 from datetime import timedelta | 7 from datetime import timedelta |
| 8 import json | 8 import json |
| 9 | 9 |
| 10 from common import time_util | |
| 11 from common.base_handler import BaseHandler, Permission | 10 from common.base_handler import BaseHandler, Permission |
| 12 from model.wf_try_job_data import WfTryJobData | 11 from model.wf_try_job_data import WfTryJobData |
| 12 from lib import time_util |
| 13 | 13 |
| 14 | 14 |
| 15 NOT_AVAILABLE = 'N/A' | 15 NOT_AVAILABLE = 'N/A' |
| 16 | 16 |
| 17 | 17 |
| 18 def _FormatDuration(start_time, end_time): | 18 def _FormatDuration(start_time, end_time): |
| 19 if not start_time or not end_time: | 19 if not start_time or not end_time: |
| 20 return NOT_AVAILABLE | 20 return NOT_AVAILABLE |
| 21 return time_util.FormatTimedelta(end_time - start_time) | 21 return time_util.FormatTimedelta(end_time - start_time) |
| 22 | 22 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 'end_date': time_util.FormatDatetime(end_date), | 124 'end_date': time_util.FormatDatetime(end_date), |
| 125 'try_jobs_in_progress': try_jobs_in_progress, | 125 'try_jobs_in_progress': try_jobs_in_progress, |
| 126 'try_jobs_with_error': try_jobs_with_error, | 126 'try_jobs_with_error': try_jobs_with_error, |
| 127 'successfully_completed_try_jobs': successfully_completed_try_jobs | 127 'successfully_completed_try_jobs': successfully_completed_try_jobs |
| 128 } | 128 } |
| 129 | 129 |
| 130 return { | 130 return { |
| 131 'template': 'try_job_dashboard.html', | 131 'template': 'try_job_dashboard.html', |
| 132 'data': data | 132 'data': data |
| 133 } | 133 } |
| OLD | NEW |