aboutsummaryrefslogtreecommitdiff
path: root/crosperf/results_cache.py
diff options
context:
space:
mode:
authorDenis Nikitin <denik@google.com>2019-07-25 16:55:37 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-07-26 22:54:37 -0700
commite2fe0ae6ceedeb93847b66560c2c010078b07def (patch)
treee3a2ccedb272d030a2f5baa2221f7f9b5f22675c /crosperf/results_cache.py
parentd3466be7b6dbf2153f093b5a03436561a659a9bd (diff)
downloadtoolchain-utils-e2fe0ae6ceedeb93847b66560c2c010078b07def.tar.gz
crosperf: Fix pylint warnings
Pylint throws a bunch of warnings on results_cache.py and results_organizer.py (other source files not checked). The change fixes most warnings EXCEPT docstring which would require more elaboration. BUG=none TEST=presubmit passess Change-Id: I4e48d94c9b430d8b224e70e9267abe3795bff7cc Reviewed-on: https://chromium-review.googlesource.com/1719770 Tested-by: Denis Nikitin <denik@chromium.org> Commit-Ready: Denis Nikitin <denik@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf/results_cache.py')
-rw-r--r--crosperf/results_cache.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index 57b8090c..4db15901 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -9,11 +9,11 @@ from __future__ import print_function
import glob
import hashlib
+import json
import os
import pickle
import re
import tempfile
-import json
from cros_utils import command_executer
from cros_utils import misc
@@ -153,7 +153,7 @@ class Result(object):
results_dict = {}
for k in keyvals_dict:
# We don't want these lines in our reports; they add no useful data.
- if k == '' or k == 'telemetry_Crosperf':
+ if not k or k == 'telemetry_Crosperf':
continue
val = keyvals_dict[k]
units = units_dict[k]
@@ -456,16 +456,15 @@ class Result(object):
# cache hit or miss. It should process results agnostic of the cache hit
# state.
# FIXME: Properly parse histograms results of the tests in the blocklist
- if self.results_file and \
- self.suite == 'telemetry_Crosperf' and \
- 'histograms.json' in self.results_file[0] and \
- self.test_name not in HISTOGRAMS_BLOCKLIST:
+ if (self.results_file and self.suite == 'telemetry_Crosperf' and
+ 'histograms.json' in self.results_file[0] and
+ self.test_name not in HISTOGRAMS_BLOCKLIST):
self.keyvals = self.ProcessHistogramsResults()
- elif self.results_file and self.suite == 'telemetry_Crosperf' and \
- 'histograms.json' in self.results_file[0]:
+ elif (self.results_file and self.suite == 'telemetry_Crosperf' and
+ 'histograms.json' in self.results_file[0]):
self.keyvals = self.ProcessChartResults()
- elif self.results_file and self.suite != 'telemetry_Crosperf' and \
- 'results-chart.json' in self.results_file[0]:
+ elif (self.results_file and self.suite != 'telemetry_Crosperf' and
+ 'results-chart.json' in self.results_file[0]):
self.keyvals = self.ProcessChartResults()
else:
if not use_cache:
@@ -802,7 +801,7 @@ class ResultsCache(object):
else:
cache_path = [os.path.join(SCRATCH_DIR, cache_dir)]
- if len(self.share_cache):
+ if self.share_cache:
for path in [x.strip() for x in self.share_cache.split(',')]:
if os.path.exists(path):
cache_path.append(os.path.join(path, cache_dir))