]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Trim/Trim.py
BaseTools: Various typo
[mirror_edk2.git] / BaseTools / Source / Python / Trim / Trim.py
index b9ca83d6d89efd771e14785087e2cae60ae44557..825ed3e5d507a3ffdc598e0a1aa57a4957f86a4e 100644 (file)
@@ -168,7 +168,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
                 InjectedFile = MatchList[1]\r
                 InjectedFile = os.path.normpath(InjectedFile)\r
                 InjectedFile = os.path.normcase(InjectedFile)\r
-                # The first injetcted file must be the preprocessed file itself\r
+                # The first injected file must be the preprocessed file itself\r
                 if PreprocessedFile == "":\r
                     PreprocessedFile = InjectedFile\r
             LineControlDirectiveFound = True\r
@@ -205,7 +205,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
             else:\r
                 if LineNumber > (len(NewLines) + 1):\r
                     for LineIndex in range(len(NewLines), LineNumber-1):\r
-                        NewLines.append(os.linesep)\r
+                        NewLines.append(TAB_LINE_BREAK)\r
                 NewLines.append(Line)\r
             LineNumber = None\r
             EdkLogger.verbose("Now we have lines: %d" % len(NewLines))\r
@@ -458,7 +458,7 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
         EdkLogger.error("Trim", FILE_OPEN_FAILURE, "File open failed for %s" %OutputFile, None)\r
 \r
     # Use a instance of BytesIO to cache data\r
-    fStringIO = BytesIO('')\r
+    fStringIO = BytesIO()\r
 \r
     for Item in VfrUniOffsetList:\r
         if (Item[0].find("Strings") != -1):\r
@@ -467,9 +467,8 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
             # GUID + Offset\r
             # { 0x8913c5e0, 0x33f6, 0x4d86, { 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66 } }\r
             #\r
-            UniGuid = [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66]\r
-            UniGuid = [chr(ItemGuid) for ItemGuid in UniGuid]\r
-            fStringIO.write(''.join(UniGuid))\r
+            UniGuid = b'\xe0\xc5\x13\x89\xf63\x86M\x9b\xf1C\xef\x89\xfc\x06f'\r
+            fStringIO.write(UniGuid)\r
             UniValue = pack ('Q', int (Item[1], 16))\r
             fStringIO.write (UniValue)\r
         else:\r
@@ -478,9 +477,8 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
             # GUID + Offset\r
             # { 0xd0bc7cb4, 0x6a47, 0x495f, { 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2 } };\r
             #\r
-            VfrGuid = [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x49, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2]\r
-            VfrGuid = [chr(ItemGuid) for ItemGuid in VfrGuid]\r
-            fStringIO.write(''.join(VfrGuid))\r
+            VfrGuid = b'\xb4|\xbc\xd0Gj_I\xaa\x11q\x07F\xda\x06\xa2'\r
+            fStringIO.write(VfrGuid)\r
             type (Item[1])\r
             VfrValue = pack ('Q', int (Item[1], 16))\r
             fStringIO.write (VfrValue)\r