summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/usb_power/convert_power_log_board.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/extra/usb_power/convert_power_log_board.py b/extra/usb_power/convert_power_log_board.py
index b970d86cd7..da0750ea86 100644
--- a/extra/usb_power/convert_power_log_board.py
+++ b/extra/usb_power/convert_power_log_board.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
# Copyright 2018 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,6 +7,9 @@
Program to convert sweetberry config to servod config template.
"""
+# Note: This is a py2/3 compatible file.
+
+from __future__ import print_function
import json
import os
import sys
@@ -60,8 +63,8 @@ def write_to_file(file, sweetberry, inas):
def main(argv):
if len(argv) != 2:
- print "usage:"
- print " %s input.board" % argv[0]
+ print("usage:")
+ print(" %s input.board" % argv[0])
return
inputf = argv[1]
@@ -72,12 +75,12 @@ def main(argv):
sweetberry = set(rec['sweetberry'] for rec in inas)
if len(sweetberry) == 2:
- print "Converting %s to %s and %s" % (inputf, basename + '_a.py',
- basename + '_b.py')
+ print("Converting %s to %s and %s" % (inputf, basename + '_a.py',
+ basename + '_b.py'))
write_to_file(basename + '_a.py', 'A', inas)
write_to_file(basename + '_b.py', 'B', inas)
else:
- print "Converting %s to %s" % (inputf, basename + '.py')
+ print("Converting %s to %s" % (inputf, basename + '.py'))
write_to_file(basename + '.py', sweetberry.pop(), inas)