From 13b9779c2260d734a678019416c6e4385ec4b100 Mon Sep 17 00:00:00 2001 From: Yilin Yang Date: Tue, 22 Sep 2020 15:23:27 +0800 Subject: 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 Change-Id: Ieb162902cb00b3ece5d70921ed806ba204136221 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422065 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu --- extra/usb_power/convert_servo_ina.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'extra') 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) -- cgit v1.2.1