aboutsummaryrefslogtreecommitdiff
path: root/crosperf/help.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2015-12-15 13:49:30 -0800
committerLuis Lozano <llozano@chromium.org>2015-12-16 17:36:06 +0000
commitf2a3ef46f75d2196a93d3ed27f4d1fcf22b54fbe (patch)
tree185d243c7eed7c7a0db6f0e640746cadc1479ea9 /crosperf/help.py
parent2a66f70fef907c1cb15229cb58e5129cb620ac98 (diff)
downloadtoolchain-utils-f2a3ef46f75d2196a93d3ed27f4d1fcf22b54fbe.tar.gz
Run pyformat on all the toolchain-utils files.
This gets rid of a lot of lint issues. Ran by doing this: for f in *.py; do echo -n "$f " ; if [ -x $f ]; then pyformat -i --remove_trailing_comma --yapf --force_quote_type=double $f ; else pyformat -i --remove_shebang --remove_trailing_comma --yapf --force_quote_type=double $f ; fi ; done BUG=chromium:567921 TEST=Ran simple crosperf run. Change-Id: I59778835fdaa5f706d2e1765924389f9e97433d1 Reviewed-on: https://chrome-internal-review.googlesource.com/242031 Reviewed-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'crosperf/help.py')
-rw-r--r--crosperf/help.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/crosperf/help.py b/crosperf/help.py
index 81e39b55..e10035aa 100644
--- a/crosperf/help.py
+++ b/crosperf/help.py
@@ -1,5 +1,4 @@
# Copyright 2011 Google Inc. All Rights Reserved.
-
"""Module to print help message."""
from __future__ import print_function
@@ -13,29 +12,30 @@ from settings_factory import LabelSettings
class Help(object):
"""The help class."""
+
def GetUsage(self):
return """%s [OPTIONS] EXPERIMENT_FILE""" % (sys.argv[0])
def _WrapLine(self, line):
- return "\n".join(textwrap.wrap(line, 80))
+ return '\n'.join(textwrap.wrap(line, 80))
def _GetFieldDescriptions(self, fields):
- res = ""
+ res = ''
for field_name in fields:
field = fields[field_name]
- res += "Field:\t\t%s\n" % field.name
- res += self._WrapLine("Description:\t%s" % field.description) + "\n"
- res += "Type:\t\t%s\n" % type(field).__name__.replace("Field", "")
- res += "Required:\t%s\n" % field.required
+ res += 'Field:\t\t%s\n' % field.name
+ res += self._WrapLine('Description:\t%s' % field.description) + '\n'
+ res += 'Type:\t\t%s\n' % type(field).__name__.replace('Field', '')
+ res += 'Required:\t%s\n' % field.required
if field.default:
- res += "Default:\t%s\n" % field.default
- res += "\n"
+ res += 'Default:\t%s\n' % field.default
+ res += '\n'
return res
def GetHelp(self):
- global_fields = self._GetFieldDescriptions(GlobalSettings("").fields)
- benchmark_fields = self._GetFieldDescriptions(BenchmarkSettings("").fields)
- label_fields = self._GetFieldDescriptions(LabelSettings("").fields)
+ global_fields = self._GetFieldDescriptions(GlobalSettings('').fields)
+ benchmark_fields = self._GetFieldDescriptions(BenchmarkSettings('').fields)
+ label_fields = self._GetFieldDescriptions(LabelSettings('').fields)
return """%s is a script for running performance experiments on
ChromeOS. It allows one to run ChromeOS Autotest benchmarks over
@@ -110,5 +110,5 @@ experiment file). Crosperf runs the experiment and caches the results
generates and displays a report based on the run, and emails the
report to the user. If the results were all read out of the cache,
then by default no email is generated.
-""" % (sys.argv[0], sys.argv[0], global_fields,
- benchmark_fields, label_fields, sys.argv[0])
+""" % (sys.argv[0], sys.argv[0], global_fields, benchmark_fields, label_fields,
+ sys.argv[0])