diff options
author | Yilin Yang <kerker@google.com> | 2020-09-22 15:23:27 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-25 09:48:29 +0000 |
commit | 13b9779c2260d734a678019416c6e4385ec4b100 (patch) | |
tree | e85c56665ce3fe10659aa675fcd8de0b342206a2 | |
parent | ec0439e97a72b35fe701b157bba63b1e40a7eafe (diff) | |
download | chrome-ec-13b9779c2260d734a678019416c6e4385ec4b100.tar.gz |
usb_power: Migrate convert_servo_ina.py to python2/3 compatible
BUG=chromium:1031705
BRANCH=master
TEST=` python2 convert_servo_ina.py kevin_r0_loc.py` can produce the
same output as before
TEST=` python3 convert_servo_ina.py kevin_r0_loc.py` can produce the
same output as before
Signed-off-by: kerker <kerker@chromium.org>
Change-Id: Ieb162902cb00b3ece5d70921ed806ba204136221
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422065
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
-rwxr-xr-x | extra/usb_power/convert_servo_ina.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/extra/usb_power/convert_servo_ina.py b/extra/usb_power/convert_servo_ina.py index aabe4967da..1dae2393a8 100755 --- a/extra/usb_power/convert_servo_ina.py +++ b/extra/usb_power/convert_servo_ina.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Copyright 2017 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. @@ -7,7 +7,9 @@ to a sweetberry config. """ +# Note: This is a py2/3 compatible file. +from __future__ import print_function import os import sys @@ -31,8 +33,8 @@ def fetch_records(basename): def main(argv): if len(argv) != 2: - print "usage:" - print " %s input.py" % argv[0] + print("usage:") + print(" %s input.py" % argv[0]) return inputf = argv[1] @@ -40,7 +42,7 @@ def main(argv): outputf = basename + '.board' outputs = basename + '.scenario' - print "Converting %s to %s, %s" % (inputf, outputf, outputs) + print("Converting %s to %s, %s" % (inputf, outputf, outputs)) inas = fetch_records(basename) |