factory: Use py3 print()
Migrate all print statement in py2 to p3 print().
BUG=chromium:999876
TEST=make test
TEST=make lint with key enable=print-statement on
Change-Id: I72c3680dbdf0e7ac1b7db2568196c3ac2708f6ca
Reviewed-on: https://chromium-review.googlesource.com/1819383
Tested-by: Yilin Yang <kerker@chromium.org>
Commit-Ready: Yilin Yang <kerker@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 4bb7861..969d1a1 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -12,6 +12,8 @@
on each device as part of the assembly process.
"""
+from __future__ import print_function
+
import logging
import os
import pipes
@@ -109,7 +111,7 @@
logging.info('writing hwid string %r', options.hwid)
GetGooftool(options).WriteHWID(options.hwid)
event_log.Log('write_hwid', hwid=options.hwid)
- print 'Wrote HWID: %r' % options.hwid
+ print('Wrote HWID: %r' % options.hwid)
@Command('read_hwid')
@@ -117,7 +119,7 @@
"""Read the HWID string from GBB."""
logging.info('reading the hwid string')
- print GetGooftool(options).ReadHWID()
+ print(GetGooftool(options).ReadHWID())
_project_cmd_arg = CmdArg(
@@ -821,7 +823,7 @@
if os.path.exists(options.file):
value_dict = chromeos_firmware.CalculateFirmwareHashes(options.file)
for key, value in value_dict.iteritems():
- print ' %s: %s' % (key, value)
+ print(' %s: %s' % (key, value))
else:
raise Error('File does not exist: %s' % options.file)