# file of PCD layout for use during the build when the platform integrator selects to use \r
# automatic offset calculation.\r
#\r
-# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
##\r
# Import Modules\r
#\r
+from __future__ import print_function\r
import Common.LongFilePathOs as os\r
import sys\r
import encodings.ascii\r
import GenVpd\r
\r
PROJECT_NAME = st.LBL_BPDG_LONG_UNI\r
-VERSION = (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)
+VERSION = (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)\r
\r
## Tool entrance method\r
#\r
EdkLogger.SetLevel(EdkLogger.VERBOSE)\r
elif Options.opt_quiet:\r
EdkLogger.SetLevel(EdkLogger.QUIET)\r
- elif Options.debug_level != None:\r
+ elif Options.debug_level is not None:\r
EdkLogger.SetLevel(Options.debug_level + 1) \r
else:\r
EdkLogger.SetLevel(EdkLogger.INFO)\r
\r
- if Options.bin_filename == None:\r
+ if Options.bin_filename is None:\r
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -o option to specify the file name for the VPD binary file") \r
- if Options.filename == None:\r
+ if Options.filename is None:\r
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file") \r
\r
Force = False\r
- if Options.opt_force != None:\r
+ if Options.opt_force is not None:\r
Force = True\r
\r
- if (Args[0] != None) :\r
+ if (Args[0] is not None) :\r
StartBpdg(Args[0], Options.filename, Options.bin_filename, Force)\r
else :\r
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify the file which contain the VPD pcd info.",\r
#\r
# Process command line firstly.\r
#\r
- parser = OptionParser(version="%s - Version %s" % (PROJECT_NAME, VERSION),
+ parser = OptionParser(version="%s - Version %s" % (PROJECT_NAME, VERSION),\r
description='',\r
prog='BPDG',\r
usage=st.LBL_BPDG_USAGE\r
#\r
def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):\r
if os.path.exists(VpdFileName) and not Force:\r
- print "\nFile %s already exist, Overwrite(Yes/No)?[Y]: " % VpdFileName\r
+ print("\nFile %s already exist, Overwrite(Yes/No)?[Y]: " % VpdFileName)\r
choice = sys.stdin.readline()\r
if choice.strip().lower() not in ['y', 'yes', '']:\r
return\r