## @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
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
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
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
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
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
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
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
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
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
\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
## 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
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
#\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
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