]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
BaseTools: Clean some coding style issues
[mirror_edk2.git] / BaseTools / Source / Python / GenPatchPcdTable / GenPatchPcdTable.py
index 50d99f7267a381b26ce333d20f0e20f792ca1776..36e539f67458b73889ed71bebf489d990733c251 100644 (file)
@@ -112,11 +112,11 @@ def _parseGeneral(lines, efifilepath):
     @param lines    line array for map file\r
     \r
     @return a list which element hold (PcdName, Offset, SectionName)\r
-    """    \r
+    """\r
     status = 0    #0 - beginning of file; 1 - PE section definition; 2 - symbol table\r
-    secs  = []    # key = section name\r
+    secs = []    # key = section name\r
     bPcds = []\r
-    \r
+\r
 \r
     for line in lines:\r
         line = line.strip()\r
@@ -128,9 +128,9 @@ def _parseGeneral(lines, efifilepath):
             continue\r
         if re.match("^entry point at", line):\r
             status = 3\r
-            continue        \r
+            continue\r
         if status == 1 and len(line) != 0:\r
-            m =  secRe.match(line)\r
+            m = secRe.match(line)\r
             assert m != 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
@@ -138,9 +138,9 @@ def _parseGeneral(lines, efifilepath):
             m = symRe.match(line)\r
             assert m != None, "Fail to parse the symbol in map file, line is %s" % line\r
             sec_no, sym_offset, sym_name, vir_addr = m.groups(0)\r
-            sec_no     = int(sec_no,     16)\r
+            sec_no = int(sec_no, 16)\r
             sym_offset = int(sym_offset, 16)\r
-            vir_addr   = int(vir_addr,   16)\r
+            vir_addr = int(vir_addr, 16)\r
             m2 = re.match('^[_]+gPcd_BinaryPatch_([\w]+)', sym_name)\r
             if m2 != None:\r
                 # fond a binary pcd entry in map file\r
@@ -179,7 +179,7 @@ def generatePcdTable(list, pcdpath):
     f.close()\r
 \r
     #print 'Success to generate Binary Patch PCD table at %s!' % pcdpath \r
-    \r
+\r
 if __name__ == '__main__':\r
     UsageString = "%prog -m <MapFile> -e <EfiFile> -o <OutFile>"\r
     AdditionalNotes = "\nPCD table is generated in file name with .BinaryPcdTable.txt postfix"\r
@@ -196,12 +196,12 @@ if __name__ == '__main__':
     if options.mapfile == None or options.efifile == None:\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
+        list = parsePcdInfoFromMapFile(options.mapfile, options.efifile)\r
         if list != None:\r
             if options.outfile != None:\r
                 generatePcdTable(list, options.outfile)\r
             else:\r
-                generatePcdTable(list, options.mapfile.replace('.map', '.BinaryPcdTable.txt')) \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
     else:\r