diff options
author | Yunlian Jiang <yunlian@google.com> | 2015-12-10 11:57:46 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-12-10 23:13:34 +0000 |
commit | a19dc5530d982f07cf829ac954c420654587f5cd (patch) | |
tree | 6c6d9bec8fcf7edca2d9514dcc91b833c0cf698b /crosperf/label.py | |
parent | a5d9505420d73e6096631c99d4b168a163ca5ad9 (diff) | |
download | toolchain-utils-a19dc5530d982f07cf829ac954c420654587f5cd.tar.gz |
crosperf: fix lint warning.
BUG=chromium:567921
TEST=label.py is clean.
Change-Id: I23820750a7eb970187bbf11a82b7e41c6c9aaf7d
Reviewed-on: https://chrome-internal-review.googlesource.com/241490
Commit-Ready: Yunlian Jiang <yunlian@google.com>
Tested-by: Yunlian Jiang <yunlian@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/label.py')
-rw-r--r-- | crosperf/label.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/crosperf/label.py b/crosperf/label.py index 2d8be114..fba91a81 100644 --- a/crosperf/label.py +++ b/crosperf/label.py @@ -1,19 +1,21 @@ -#!/usr/bin/python - # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """The label of benchamrks.""" +from __future__ import print_function + +import hashlib import os from image_checksummer import ImageChecksummer -from utils.file_utils import FileUtils -from utils import misc +from cros_utils.file_utils import FileUtils +from cros_utils import misc class Label(object): + """The label class.""" def __init__(self, name, chromeos_image, chromeos_root, board, remote, image_args, cache_dir, cache_only, log_level, compiler, chrome_src=None): @@ -51,11 +53,12 @@ class Label(object): self.chromeos_root = chromeos_root if not chrome_src: - self.chrome_src = os.path.join(self.chromeos_root, + self.chrome_src = os.path.join( + self.chromeos_root, ".cache/distfiles/target/chrome-src-internal") if not os.path.exists(self.chrome_src): self.chrome_src = os.path.join(self.chromeos_root, - ".cache/distfiles/target/chrome-src") + ".cache/distfiles/target/chrome-src") else: chromeos_src = misc.CanonicalizePath(chrome_src) if not chromeos_src: @@ -85,21 +88,22 @@ class Label(object): return image_type def __hash__(self): - """Label objects are used in a map, so provide "hash" and "equal".""" + """Label objects are used in a map, so provide "hash" and "equal".""" - return hash(self.name) + return hash(self.name) def __eq__(self, other): - """Label objects are used in a map, so provide "hash" and "equal".""" + """Label objects are used in a map, so provide "hash" and "equal".""" - return isinstance(other, Label) and other.name == self.name + return isinstance(other, Label) and other.name == self.name def __str__(self): - """For better debugging.""" + """For better debugging.""" - return 'label[name="{}"]'.format(self.name) + return 'label[name="{}"]'.format(self.name) class MockLabel(object): + """The mock label class.""" def __init__(self, name, chromeos_image, chromeos_root, board, remote, image_args, cache_dir, cache_only, log_level, compiler, chrome_src=None): |