From f6ef4395fe1896ba68c80e52cb24763b0fcfe7f8 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Thu, 6 Apr 2017 17:16:05 -0700 Subject: [toolchain-utils] Fix remaining lint errors in toolchain-utils. In addition to fixing the lint errors, this also fixes the Python formatting issues (ran tc_pyformat on nearly all the files). BUG=chromium:570450 TEST=Ran all crosperf & bisect tool unit tests. Ran afe_lock_machine.py (check machine status) Ran full crosperf test (octane, speedometer, BootPerf) on alex. Change-Id: Ic86f9192801ac67769f3de30f1c5f0d203ce0831 Reviewed-on: https://chromium-review.googlesource.com/471886 Commit-Ready: Caroline Tice Tested-by: Caroline Tice Reviewed-by: Manoj Gupta --- weekly_report.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'weekly_report.py') diff --git a/weekly_report.py b/weekly_report.py index e74c623d..01db867d 100755 --- a/weekly_report.py +++ b/weekly_report.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python2 # # Copyright Google Inc. 2014 """Module to generate the 7-day crosperf reports.""" @@ -55,8 +55,8 @@ benchmark: all_toolchain_perf { chromeos_root: %s chromeos_image: %s } -""" % (test_name, chromeos_root, os.path.join(test_path, - 'chromiumos_test_image.bin')) +""" % (test_name, chromeos_root, + os.path.join(test_path, 'chromiumos_test_image.bin')) f.write(test_image) return filename @@ -109,8 +109,8 @@ benchmark: all_toolchain_perf { chromeos_root: %s chromeos_image: %s } -""" % (test_name, chromeos_root, os.path.join(test_path, - 'chromiumos_test_image.bin')) +""" % (test_name, chromeos_root, + os.path.join(test_path, 'chromiumos_test_image.bin')) f.write(test_image) return filename @@ -121,13 +121,14 @@ def Main(argv): parser = argparse.ArgumentParser() parser.add_argument('-b', '--board', dest='board', help='Target board.') parser.add_argument('-r', '--remote', dest='remote', help='Target device.') - parser.add_argument('-v', - '--vanilla_only', - dest='vanilla_only', - action='store_true', - default=False, - help='Generate a report comparing only the vanilla ' - 'images.') + parser.add_argument( + '-v', + '--vanilla_only', + dest='vanilla_only', + action='store_true', + default=False, + help='Generate a report comparing only the vanilla ' + 'images.') options = parser.parse_args(argv[1:]) @@ -200,8 +201,8 @@ def Main(argv): timestamp = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d_%H:%M:%S') results_dir = os.path.join( - os.path.expanduser('~/nightly_test_reports'), '%s.%s' % ( - timestamp, options.board), 'weekly_tests') + os.path.expanduser('~/nightly_test_reports'), + '%s.%s' % (timestamp, options.board), 'weekly_tests') for day in WEEKDAYS: startdir = os.path.join(constants.CROSTC_WORKSPACE, day) @@ -232,8 +233,8 @@ def Main(argv): # Run Crosperf on the file to generate the weekly report. cmd = ('%s/toolchain-utils/crosperf/crosperf ' - '%s --no_email=True --results_dir=%s' % - (constants.CROSTC_WORKSPACE, filename, results_dir)) + '%s --no_email=True --results_dir=%s' % (constants.CROSTC_WORKSPACE, + filename, results_dir)) retv = cmd_executer.RunCommand(cmd) if retv == 0: # Send the email, if the crosperf command worked. -- cgit v1.2.3