]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
BaseTools: Refactor python print statements
[mirror_edk2.git] / BaseTools / Source / Python / GenPatchPcdTable / GenPatchPcdTable.py
index 2a039480a00ae22839a226e7e4b9687d42ec8c13..d7084fbe88dacfc4440cf7fa448bcda1f312ab68 100644 (file)
@@ -17,6 +17,7 @@
 #\r
 \r
 #======================================  External Libraries ========================================\r
+from __future__ import print_function\r
 import optparse\r
 import Common.LongFilePathOs as os\r
 import re\r
@@ -31,7 +32,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
 # Version and Copyright\r
 __version_number__ = ("0.10" + " " + gBUILD_VERSION)\r
 __version__ = "%prog Version " + __version_number__\r
-__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved."\r
+__copyright__ = "Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved."\r
 \r
 #======================================  Internal Libraries ========================================\r
 \r
@@ -152,7 +153,7 @@ def _parseGeneral(lines, efifilepath):
             status = 3\r
             continue\r
         if status == 1 and len(line) != 0:\r
-            m = secRe.match(line)\r
+            m = secReGeneral.match(line)\r
             assert m is not None, "Fail to parse the section in map file , line is %s" % line\r
             sec_no, sec_start, sec_length, sec_name, sec_class = m.groups(0)\r
             secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_length, 16), sec_name, sec_class])\r
@@ -216,7 +217,7 @@ if __name__ == '__main__':
     (options, args) = parser.parse_args()\r
 \r
     if options.mapfile is None or options.efifile is None:\r
-        print parser.get_usage()\r
+        print(parser.get_usage())\r
     elif os.path.exists(options.mapfile) and os.path.exists(options.efifile):\r
         list = parsePcdInfoFromMapFile(options.mapfile, options.efifile)\r
         if list is not None:\r
@@ -225,6 +226,6 @@ if __name__ == '__main__':
             else:\r
                 generatePcdTable(list, options.mapfile.replace('.map', '.BinaryPcdTable.txt'))\r
         else:\r
-            print 'Fail to generate Patch PCD Table based on map file and efi file'\r
+            print('Fail to generate Patch PCD Table based on map file and efi file')\r
     else:\r
-        print 'Fail to generate Patch PCD Table for fail to find map file or efi file!'\r
+        print('Fail to generate Patch PCD Table for fail to find map file or efi file!')\r