]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/BPDG/BPDG.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / BPDG / BPDG.py
index 86c44abb67a6c956a7907b4b5e82a18e93cde8a5..07cee8976208169bf6cd294b47e43cfd251014b5 100644 (file)
@@ -1,12 +1,12 @@
 ## @file\r
 #  Intel Binary Product Data Generation Tool (Intel BPDG).\r
-#  This tool provide a simple process for the creation of a binary file containing read-only \r
-#  configuration data for EDK II platforms that contain Dynamic and DynamicEx PCDs described \r
-#  in VPD sections. It also provide an option for specifying an alternate name for a mapping \r
-#  file of PCD layout for use during the build when the platform integrator selects to use \r
+#  This tool provide a simple process for the creation of a binary file containing read-only\r
+#  configuration data for EDK II platforms that contain Dynamic and DynamicEx PCDs described\r
+#  in VPD sections. It also provide an option for specifying an alternate name for a mapping\r
+#  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>\r
+#  Copyright (c) 2010 - 2018, 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
@@ -47,26 +47,26 @@ VERSION            = (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)
 #\r
 def main():\r
     global Options, Args\r
-    \r
+\r
     # Initialize log system\r
-    EdkLogger.Initialize()          \r
+    EdkLogger.Initialize()\r
     Options, Args = MyOptionParser()\r
-    \r
+\r
     ReturnCode = 0\r
-    \r
+\r
     if Options.opt_verbose:\r
         EdkLogger.SetLevel(EdkLogger.VERBOSE)\r
     elif Options.opt_quiet:\r
         EdkLogger.SetLevel(EdkLogger.QUIET)\r
     elif Options.debug_level is not None:\r
-        EdkLogger.SetLevel(Options.debug_level + 1) \r
+        EdkLogger.SetLevel(Options.debug_level + 1)\r
     else:\r
         EdkLogger.SetLevel(EdkLogger.INFO)\r
-                  \r
+\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
+        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 is None:\r
-        EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file")  \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 is not None:\r
@@ -76,8 +76,8 @@ def main():
         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
-                        None)         \r
-    \r
+                        None)\r
+\r
     return ReturnCode\r
 \r
 \r
@@ -87,8 +87,8 @@ def main():
 #\r
 #   @retval options   A optparse.Values object containing the parsed options\r
 #   @retval args      Target of BPDG command\r
-#            \r
-def MyOptionParser():   \r
+#\r
+def MyOptionParser():\r
     #\r
     # Process command line firstly.\r
     #\r
@@ -106,10 +106,10 @@ def MyOptionParser():
     parser.add_option('-o', '--vpd-filename', action='store', dest='bin_filename',\r
                       help=st.MSG_OPTION_VPD_FILENAME)\r
     parser.add_option('-m', '--map-filename', action='store', dest='filename',\r
-                      help=st.MSG_OPTION_MAP_FILENAME)   \r
+                      help=st.MSG_OPTION_MAP_FILENAME)\r
     parser.add_option('-f', '--force', action='store_true', dest='opt_force',\r
-                      help=st.MSG_OPTION_FORCE)     \r
-    \r
+                      help=st.MSG_OPTION_FORCE)\r
+\r
     (options, args) = parser.parse_args()\r
     if len(args) == 0:\r
         EdkLogger.info("Please specify the filename.txt file which contain the VPD pcd info!")\r
@@ -118,7 +118,7 @@ def MyOptionParser():
     return options, args\r
 \r
 \r
-## Start BPDG and call the main functions \r
+## Start BPDG and call the main functions\r
 #\r
 # This method mainly focus on call GenVPD class member functions to complete\r
 # BPDG's target. It will process VpdFile override, and provide the interface file\r
@@ -137,19 +137,19 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):
         choice = sys.stdin.readline()\r
         if choice.strip().lower() not in ['y', 'yes', '']:\r
             return\r
-        \r
+\r
     GenVPD = GenVpd.GenVPD (InputFileName, MapFileName, VpdFileName)\r
-    \r
-    EdkLogger.info('%-24s = %s' % ("VPD input data file: ", InputFileName))  \r
+\r
+    EdkLogger.info('%-24s = %s' % ("VPD input data file: ", InputFileName))\r
     EdkLogger.info('%-24s = %s' % ("VPD output map file: ", MapFileName))\r
-    EdkLogger.info('%-24s = %s' % ("VPD output binary file: ", VpdFileName))  \r
-          \r
+    EdkLogger.info('%-24s = %s' % ("VPD output binary file: ", VpdFileName))\r
+\r
     GenVPD.ParserInputFile()\r
     GenVPD.FormatFileLine()\r
     GenVPD.FixVpdOffset()\r
     GenVPD.GenerateVpdFile(MapFileName, VpdFileName)\r
-    \r
-    EdkLogger.info("- Vpd pcd fixed done! -")    \r
+\r
+    EdkLogger.info("- Vpd pcd fixed done! -")\r
 \r
 if __name__ == '__main__':\r
     r = main()\r
@@ -157,4 +157,4 @@ if __name__ == '__main__':
     if r < 0 or r > 127: r = 1\r
     sys.exit(r)\r
 \r
-    \r
+\r