]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py
BaseTools: Various typo
[mirror_edk2.git] / BaseTools / Source / Python / UPT / PomAdapter / InfPomAlignmentMisc.py
index 042d4784c84cc4666502cc1b56797829201c363b..68f281b5217a6486c67afacf0408d156010a248e 100644 (file)
@@ -1,11 +1,11 @@
 ## @file InfPomAlignmentMisc.py\r
 # This file contained the routines for InfPomAlignment\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
 #\r
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
@@ -24,7 +24,7 @@ from Library import DataType as DT
 from Library.Misc import ConvertArchList\r
 from Object.POM.ModuleObject import BinaryFileObject\r
 from Object.POM import CommonObject\r
-from Library.String import FORMAT_INVALID\r
+from Library.StringUtils import FORMAT_INVALID\r
 from Library.Misc import CheckGuidRegFormat\r
 from Logger import StringTable as ST\r
 \r
@@ -45,7 +45,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
     CustomMakefile = DefineObj.GetCustomMakefile()\r
     UefiHiiResourceSection = DefineObj.GetUefiHiiResourceSection()\r
 \r
-    if EdkReleaseVersion != None:\r
+    if EdkReleaseVersion is not None:\r
         Name = DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION\r
         Value = EdkReleaseVersion.GetValue()\r
         Statement = _GenInfDefineStateMent(EdkReleaseVersion.Comments.GetHeaderComments(),\r
@@ -54,7 +54,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            EdkReleaseVersion.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if Shadow != None:\r
+    if Shadow is not None:\r
         Name = DT.TAB_INF_DEFINES_SHADOW\r
         Value = Shadow.GetValue()\r
         Statement = _GenInfDefineStateMent(Shadow.Comments.GetHeaderComments(),\r
@@ -63,7 +63,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            Shadow.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if DpxSource != None:\r
+    if DpxSource is not None:\r
         Name = DT.TAB_INF_DEFINES_DPX_SOURCE\r
         for DpxSourceItem in DpxSource:\r
             Value = DpxSourceItem[0]\r
@@ -73,7 +73,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                                DpxSourceItem[1].GetTailComments())\r
             DefinesDictNew[Statement] = ArchString\r
 \r
-    if PciVendorId != None:\r
+    if PciVendorId is not None:\r
         Name = DT.TAB_INF_DEFINES_PCI_VENDOR_ID\r
         Value = PciVendorId.GetValue()\r
         Statement = _GenInfDefineStateMent(PciVendorId.Comments.GetHeaderComments(),\r
@@ -82,7 +82,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            PciVendorId.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if PciDeviceId != None:\r
+    if PciDeviceId is not None:\r
         Name = DT.TAB_INF_DEFINES_PCI_DEVICE_ID\r
         Value = PciDeviceId.GetValue()\r
         Statement = _GenInfDefineStateMent(PciDeviceId.Comments.GetHeaderComments(),\r
@@ -91,7 +91,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            PciDeviceId.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if PciClassCode != None:\r
+    if PciClassCode is not None:\r
         Name = DT.TAB_INF_DEFINES_PCI_CLASS_CODE\r
         Value = PciClassCode.GetValue()\r
         Statement = _GenInfDefineStateMent(PciClassCode.Comments.GetHeaderComments(),\r
@@ -100,7 +100,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            PciClassCode.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if PciRevision != None:\r
+    if PciRevision is not None:\r
         Name = DT.TAB_INF_DEFINES_PCI_REVISION\r
         Value = PciRevision.GetValue()\r
         Statement = _GenInfDefineStateMent(PciRevision.Comments.GetHeaderComments(),\r
@@ -109,7 +109,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
                                            PciRevision.Comments.GetTailComments())\r
         DefinesDictNew[Statement] = ArchString\r
 \r
-    if PciCompress != None:\r
+    if PciCompress is not None:\r
         Name = DT.TAB_INF_DEFINES_PCI_COMPRESS\r
         Value = PciCompress.GetValue()\r
         Statement = _GenInfDefineStateMent(PciCompress.Comments.GetHeaderComments(),\r
@@ -138,7 +138,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
 \r
             DefinesDictNew[Statement] = ArchString\r
 \r
-    if UefiHiiResourceSection != None:\r
+    if UefiHiiResourceSection is not None:\r
         Name = DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION\r
         Value = UefiHiiResourceSection.GetValue()\r
         HeaderComment = UefiHiiResourceSection.Comments.GetHeaderComments()\r
@@ -155,10 +155,10 @@ def GenModuleHeaderUserExt(DefineObj, ArchString):
 ## Generate the define statement that will be put into userextension\r
 #  Not support comments.\r
 #\r
-# @param HeaderComment: the original header comment (# not remvoed)\r
+# @param HeaderComment: the original header comment (# not removed)\r
 # @param Name: the definition keyword, should not be empty or none\r
 # @param Value: the definition keyword value\r
-# @param TailComment: the original Tail comment (# not remvoed)\r
+# @param TailComment: the original Tail comment (# not removed)\r
 #\r
 # @return: the regenerated define statement\r
 #\r
@@ -184,18 +184,17 @@ def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryFileObj
         else:\r
             TagName = ''\r
             Family = ''\r
-        \r
+\r
         FFE = ItemObj.GetFeatureFlagExp()\r
 \r
         #\r
         # If have architecturie specified, then use the specified architecturie;\r
         # If the section tag does not have an architecture modifier or the modifier is "common" (case in-sensitive),\r
-        # and the VALID_ARCHITECTURES comment exists, the list from the VALID_ARCHITECTURES comment \r
+        # and the VALID_ARCHITECTURES comment exists, the list from the VALID_ARCHITECTURES comment\r
         # can be used for the attribute.\r
         # If both not have VALID_ARCHITECTURE comment and no architecturie specified, then keep it empty.\r
-        #        \r
-        SupArchList = ConvertArchList(ItemObj.GetSupArchList())\r
-        SupArchList.sort()\r
+        #\r
+        SupArchList = sorted(ConvertArchList(ItemObj.GetSupArchList()))\r
         if len(SupArchList) == 1 and SupArchList[0] == 'COMMON':\r
             if not (len(OriSupArchList) == 1 or OriSupArchList[0] == 'COMMON'):\r
                 SupArchList = OriSupArchList\r
@@ -209,7 +208,7 @@ def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryFileObj
         #\r
         # Get GUID value of the GUID CName in the DEC file\r
         #\r
-        if ItemObj.GetType() == DT.SUBTYPE_GUID_BINARY_FILE_TYPE:                \r
+        if ItemObj.GetType() == DT.SUBTYPE_GUID_BINARY_FILE_TYPE:\r
             if not CheckGuidRegFormat(ItemObj.GetGuidValue()):\r
                 if not DecObjList:\r
                     if DT.TAB_HORIZON_LINE_SPLIT in ItemObj.GetGuidValue() or \\r
@@ -232,12 +231,12 @@ def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryFileObj
                                 FileNameObj.SetGuidValue(GuidObj.GetGuid())\r
                                 break\r
 \r
-                    if not FileNameObj.GetGuidValue():                        \r
+                    if not FileNameObj.GetGuidValue():\r
                         Logger.Error("\nMkPkg",\r
                                          FORMAT_INVALID,\r
                                          ST.ERR_DECPARSE_CGUID_NOT_FOUND % \\r
                                          (ItemObj.GetGuidValue()),\r
-                                         RaiseError=True)  \r
+                                         RaiseError=True)\r
             else:\r
                 FileNameObj.SetGuidValue(ItemObj.GetGuidValue().strip())\r
 \r