OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """This file contains printing-related functionality of the bisect.""" | 5 """This file contains printing-related functionality of the bisect.""" |
6 | 6 |
7 import datetime | 7 import datetime |
8 import re | 8 import re |
9 | 9 |
10 from bisect_results import BisectResults | 10 from bisect_results import BisectResults |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 step_build_time_avg = step_build_time_avg / step_count | 197 step_build_time_avg = step_build_time_avg / step_count |
198 print | 198 print |
199 print 'Average build time : %s' % datetime.timedelta( | 199 print 'Average build time : %s' % datetime.timedelta( |
200 seconds=int(step_build_time_avg)) | 200 seconds=int(step_build_time_avg)) |
201 print 'Average test time : %s' % datetime.timedelta( | 201 print 'Average test time : %s' % datetime.timedelta( |
202 seconds=int(step_perf_time_avg)) | 202 seconds=int(step_perf_time_avg)) |
203 | 203 |
204 @staticmethod | 204 @staticmethod |
205 def _GetViewVCLinkFromDepotAndHash(git_revision, depot): | 205 def _GetViewVCLinkFromDepotAndHash(git_revision, depot): |
206 """Gets link to the repository browser.""" | 206 """Gets link to the repository browser.""" |
207 if depot and bisect_utils.DEPOT_DEPS_NAME[depot].has_key('viewvc'): | 207 if depot and 'viewvc' in bisect_utils.DEPOT_DEPS_NAME[depot]: |
208 return bisect_utils.DEPOT_DEPS_NAME[depot]['viewvc'] + git_revision | 208 return bisect_utils.DEPOT_DEPS_NAME[depot]['viewvc'] + git_revision |
209 return '' | 209 return '' |
210 | 210 |
211 def _PrintRevisionInfo(self, cl, info, depot=None): | 211 def _PrintRevisionInfo(self, cl, info, depot=None): |
212 commit_link = self._GetViewVCLinkFromDepotAndHash(cl, depot) | 212 commit_link = self._GetViewVCLinkFromDepotAndHash(cl, depot) |
213 if commit_link: | 213 if commit_link: |
214 commit_link = '\nLink : %s' % commit_link | 214 commit_link = '\nLink : %s' % commit_link |
215 else: | 215 else: |
216 commit_link = ('\Description:\n%s' % info['body']) | 216 commit_link = ('\Description:\n%s' % info['body']) |
217 print RESULTS_REVISION_INFO % { | 217 print RESULTS_REVISION_INFO % { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 @staticmethod | 407 @staticmethod |
408 def _PrintWarnings(warnings): | 408 def _PrintWarnings(warnings): |
409 """Prints a list of warning strings if there are any.""" | 409 """Prints a list of warning strings if there are any.""" |
410 if not warnings: | 410 if not warnings: |
411 return | 411 return |
412 print | 412 print |
413 print 'WARNINGS:' | 413 print 'WARNINGS:' |
414 for w in set(warnings): | 414 for w in set(warnings): |
415 print ' ! %s' % w | 415 print ' ! %s' % w |
OLD | NEW |