From b05a65a748bd2e2542e7b05f629d3bc69c8d8135 Mon Sep 17 00:00:00 2001 From: Amin Hassani Date: Mon, 18 Dec 2017 15:15:32 -0800 Subject: update_payload: Fix most of lint styling issues. This patch fixes a lot of pylint issues in the update_engine scripts. Majority of this changes are based on recommendation found in: https://www.chromium.org/chromium-os/python-style-guidelines It is a good idea to do these changes now, because if there are many pylint errors when performing 'repo upload', serious problems can be overshadowed by a lot of noise and eventually cause problems. These fixes include: - Fixing executable shebangs to /usr/bin/python2. - Fixing import-error problems by disabiling them. - Removing pylint disables that are not valid anymore. - Changing all imports to proper absolute import format. - Change the import of PayloadError from update_payload.PayloadError for simplicity. - Add pydoc strings for functions and classes that were missing. The remaining unchanged pylint problmes include: - The header files of these scripts are in CrOS copyright format, but the the cros lint hook is configured to AoSP copyright format. - The test* functions in unittests are not compatible with CamelCase format. BUG=chromium:796338 TEST=unittests pass TEST=start_devserver TEST=cros flash TEST=scripts/paycheck.py Change-Id: I7eed4d1625eb7c510c7949fada120de5a6a26c7b Reviewed-on: https://chromium-review.googlesource.com/834875 Commit-Ready: Amin Hassani Tested-by: Amin Hassani Reviewed-by: Ben Chan Reviewed-by: Sen Jiang --- scripts/update_payload/histogram_unittest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/update_payload/histogram_unittest.py') diff --git a/scripts/update_payload/histogram_unittest.py b/scripts/update_payload/histogram_unittest.py index 421ff203..643bb321 100755 --- a/scripts/update_payload/histogram_unittest.py +++ b/scripts/update_payload/histogram_unittest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # # 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 @@ -8,11 +8,12 @@ import unittest -import format_utils -import histogram +from update_payload import format_utils +from update_payload import histogram class HistogramTest(unittest.TestCase): + """ Tests histogram""" @staticmethod def AddHumanReadableSize(size): -- cgit v1.2.3