Statement = '# Guid: ' + LibraryItem.Guid + ' Version: ' + LibraryItem.Version\r
\r
if len(BinaryFile.SupArchList) == 0:\r
- if LibraryClassDict.has_key('COMMON') and Statement not in LibraryClassDict['COMMON']:\r
+ if 'COMMON' in LibraryClassDict and Statement not in LibraryClassDict['COMMON']:\r
LibraryClassDict['COMMON'].append(Statement)\r
else:\r
LibraryClassDict['COMMON'] = ['## @LIB_INSTANCES']\r
LibraryClassDict['COMMON'].append(Statement)\r
else:\r
for Arch in BinaryFile.SupArchList:\r
- if LibraryClassDict.has_key(Arch):\r
+ if Arch in LibraryClassDict:\r
if Statement not in LibraryClassDict[Arch]:\r
LibraryClassDict[Arch].append(Statement)\r
else:\r
Statement += RelaPath.replace('\\', '/')\r
if FFE:\r
Statement += '|' + FFE\r
- ArchList = PackageDependency.GetSupArchList()\r
- ArchList.sort()\r
+ ArchList = sorted(PackageDependency.GetSupArchList())\r
SortedArch = ' '.join(ArchList)\r
if SortedArch in NewSectionDict:\r
NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]\r
SourceFile = Source.GetSourceFile()\r
Family = Source.GetFamily()\r
FeatureFlag = Source.GetFeatureFlag()\r
- SupArchList = Source.GetSupArchList()\r
- SupArchList.sort()\r
+ SupArchList = sorted(Source.GetSupArchList())\r
SortedArch = ' '.join(SupArchList)\r
Statement = GenSourceStatement(ConvertPath(SourceFile), Family, FeatureFlag)\r
if SortedArch in NewSectionDict:\r
#\r
# merge duplicate items\r
#\r
- ArchList = Guid.GetSupArchList()\r
- ArchList.sort()\r
+ ArchList = sorted(Guid.GetSupArchList())\r
SortedArch = ' '.join(ArchList)\r
if (Statement, SortedArch) in GuidDict:\r
PreviousComment = GuidDict[Statement, SortedArch]\r
#\r
# merge duplicate items\r
#\r
- ArchList = Object.GetSupArchList()\r
- ArchList.sort()\r
+ ArchList = sorted(Object.GetSupArchList())\r
SortedArch = ' '.join(ArchList)\r
if (Statement, SortedArch) in Dict:\r
PreviousComment = Dict[Statement, SortedArch]\r
#\r
# Merge duplicate entries\r
#\r
- ArchList = Pcd.GetSupArchList()\r
- ArchList.sort()\r
+ ArchList = sorted(Pcd.GetSupArchList())\r
SortedArch = ' '.join(ArchList)\r
if (Statement, SortedArch) in Dict:\r
PreviousComment = Dict[Statement, SortedArch]\r
if FileNameObjList:\r
ArchList = FileNameObjList[0].GetSupArchList()\r
if len(ArchList) == 0:\r
- if PatchPcdDict.has_key(DT.TAB_ARCH_COMMON):\r
+ if DT.TAB_ARCH_COMMON in PatchPcdDict:\r
if Statement not in PatchPcdDict[DT.TAB_ARCH_COMMON]:\r
PatchPcdDict[DT.TAB_ARCH_COMMON].append(Statement)\r
else:\r
PatchPcdDict[DT.TAB_ARCH_COMMON] = [Statement]\r
else:\r
for Arch in ArchList:\r
- if PatchPcdDict.has_key(Arch):\r
+ if Arch in PatchPcdDict:\r
if Statement not in PatchPcdDict[Arch]:\r
PatchPcdDict[Arch].append(Statement)\r
else:\r
ArchList = FileNameObjList[0].GetSupArchList()\r
\r
if len(ArchList) == 0:\r
- if PcdExDict.has_key('COMMON'):\r
+ if 'COMMON' in PcdExDict:\r
PcdExDict['COMMON'].append(Statement)\r
else:\r
PcdExDict['COMMON'] = [Statement]\r
else:\r
for Arch in ArchList:\r
- if PcdExDict.has_key(Arch):\r
+ if Arch in PcdExDict:\r
if Statement not in PcdExDict[Arch]:\r
PcdExDict[Arch].append(Statement)\r
else:\r
if CommentStr and not CommentStr.endswith('\n#\n'):\r
CommentStr = CommentStr + '#\n'\r
NewStateMent = CommentStr + Statement\r
- SupArch = Obj.GetSupArchList()\r
- SupArch.sort()\r
+ SupArch = sorted(Obj.GetSupArchList())\r
SortedArch = ' '.join(SupArch)\r
if SortedArch in NewSectionDict:\r
NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [NewStateMent]\r
for BuilOptionItem in BinaryFile.AsBuiltList[0].BinaryBuildFlagList:\r
Statement = '#' + BuilOptionItem.AsBuiltOptionFlags\r
if len(BinaryFile.SupArchList) == 0:\r
- if BuildOptionDict.has_key('COMMON'):\r
+ if 'COMMON' in BuildOptionDict:\r
if Statement not in BuildOptionDict['COMMON']:\r
BuildOptionDict['COMMON'].append(Statement)\r
else:\r
BuildOptionDict['COMMON'].append(Statement)\r
else:\r
for Arch in BinaryFile.SupArchList:\r
- if BuildOptionDict.has_key(Arch):\r
+ if Arch in BuildOptionDict:\r
if Statement not in BuildOptionDict[Arch]:\r
BuildOptionDict[Arch].append(Statement)\r
else:\r
FileName = ConvertPath(FileNameObj.GetFilename())\r
FileType = FileNameObj.GetFileType()\r
FFE = FileNameObj.GetFeatureFlag()\r
- ArchList = FileNameObj.GetSupArchList()\r
- ArchList.sort()\r
+ ArchList = sorted(FileNameObj.GetSupArchList())\r
SortedArch = ' '.join(ArchList)\r
Key = (FileName, FileType, FFE, SortedArch)\r
if Key in BinariesDict:\r