mirror of https://github.com/acidanthera/audk.git
BaseTools: do the list and iterator translation
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
86e6cf98a8
commit
00fcce9153
|
@ -518,7 +518,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||
for BuildData in PGen.BuildDatabase._CACHE_.values():
|
||||
if BuildData.Arch != Arch:
|
||||
continue
|
||||
for key in BuildData.Pcds:
|
||||
for key in list(BuildData.Pcds.keys()):
|
||||
for SinglePcd in GlobalData.MixedPcd:
|
||||
if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) == SinglePcd:
|
||||
for item in GlobalData.MixedPcd[SinglePcd]:
|
||||
|
@ -864,7 +864,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||
def _CheckAllPcdsTokenValueConflict(self):
|
||||
for Pa in self.AutoGenObjectList:
|
||||
for Package in Pa.PackageList:
|
||||
PcdList = Package.Pcds.values()
|
||||
PcdList = list(Package.Pcds.values())
|
||||
PcdList.sort(key=lambda x: int(x.TokenValue, 0))
|
||||
Count = 0
|
||||
while (Count < len(PcdList) - 1) :
|
||||
|
@ -910,7 +910,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||
Count += SameTokenValuePcdListCount
|
||||
Count += 1
|
||||
|
||||
PcdList = Package.Pcds.values()
|
||||
PcdList = list(Package.Pcds.values())
|
||||
PcdList.sort(key=lambda x: "%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName))
|
||||
Count = 0
|
||||
while (Count < len(PcdList) - 1) :
|
||||
|
@ -1179,7 +1179,7 @@ class PlatformAutoGen(AutoGen):
|
|||
if os.path.exists(VpdMapFilePath):
|
||||
OrgVpdFile.Read(VpdMapFilePath)
|
||||
PcdItems = OrgVpdFile.GetOffset(PcdNvStoreDfBuffer[0])
|
||||
NvStoreOffset = PcdItems.values()[0].strip() if PcdItems else '0'
|
||||
NvStoreOffset = list(PcdItems.values())[0].strip() if PcdItems else '0'
|
||||
else:
|
||||
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
|
||||
|
||||
|
@ -1229,7 +1229,7 @@ class PlatformAutoGen(AutoGen):
|
|||
FdfModuleList.append(os.path.normpath(InfName))
|
||||
for M in self._MaList:
|
||||
# F is the Module for which M is the module autogen
|
||||
for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:
|
||||
for PcdFromModule in list(M.ModulePcdList) + list(M.LibraryPcdList):
|
||||
# make sure that the "VOID*" kind of datum has MaxDatumSize set
|
||||
if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:
|
||||
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, M.MetaFile))
|
||||
|
@ -1378,7 +1378,7 @@ class PlatformAutoGen(AutoGen):
|
|||
if (self.Workspace.ArchList[-1] == self.Arch):
|
||||
for Pcd in self._DynamicPcdList:
|
||||
# just pick the a value to determine whether is unicode string type
|
||||
Sku = Pcd.SkuInfoList.values()[0]
|
||||
Sku = list(Pcd.SkuInfoList.values())[0]
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
|
@ -1477,7 +1477,7 @@ class PlatformAutoGen(AutoGen):
|
|||
if not FoundFlag :
|
||||
# just pick the a value to determine whether is unicode string type
|
||||
SkuValueMap = {}
|
||||
SkuObjList = DscPcdEntry.SkuInfoList.items()
|
||||
SkuObjList = list(DscPcdEntry.SkuInfoList.items())
|
||||
DefaultSku = DscPcdEntry.SkuInfoList.get(TAB_DEFAULT)
|
||||
if DefaultSku:
|
||||
defaultindex = SkuObjList.index((TAB_DEFAULT, DefaultSku))
|
||||
|
@ -1503,7 +1503,7 @@ class PlatformAutoGen(AutoGen):
|
|||
DscPcdEntry.TokenSpaceGuidValue = eachDec.Guids[DecPcdEntry.TokenSpaceGuidCName]
|
||||
# Only fix the value while no value provided in DSC file.
|
||||
if not Sku.DefaultValue:
|
||||
DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]].DefaultValue = DecPcdEntry.DefaultValue
|
||||
DscPcdEntry.SkuInfoList[list(DscPcdEntry.SkuInfoList.keys())[0]].DefaultValue = DecPcdEntry.DefaultValue
|
||||
|
||||
if DscPcdEntry not in self._DynamicPcdList:
|
||||
self._DynamicPcdList.append(DscPcdEntry)
|
||||
|
@ -1579,7 +1579,7 @@ class PlatformAutoGen(AutoGen):
|
|||
# Delete the DynamicPcdList At the last time enter into this function
|
||||
for Pcd in self._DynamicPcdList:
|
||||
# just pick the a value to determine whether is unicode string type
|
||||
Sku = Pcd.SkuInfoList.values()[0]
|
||||
Sku = list(Pcd.SkuInfoList.values())[0]
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
|
@ -2144,7 +2144,7 @@ class PlatformAutoGen(AutoGen):
|
|||
Pcd.MaxDatumSize = str(len(Value.split(',')))
|
||||
else:
|
||||
Pcd.MaxDatumSize = str(len(Value) - 1)
|
||||
return Pcds.values()
|
||||
return list(Pcds.values())
|
||||
|
||||
## Resolve library names to library modules
|
||||
#
|
||||
|
@ -2248,7 +2248,7 @@ class PlatformAutoGen(AutoGen):
|
|||
# Use the highest priority value.
|
||||
#
|
||||
if (len(OverrideList) >= 2):
|
||||
KeyList = OverrideList.keys()
|
||||
KeyList = list(OverrideList.keys())
|
||||
for Index in range(len(KeyList)):
|
||||
NowKey = KeyList[Index]
|
||||
Target1, ToolChain1, Arch1, CommandType1, Attr1 = NowKey.split("_")
|
||||
|
@ -2370,9 +2370,9 @@ class PlatformAutoGen(AutoGen):
|
|||
if Attr == TAB_TOD_DEFINES_BUILDRULEORDER:
|
||||
BuildRuleOrder = Options[Tool][Attr]
|
||||
|
||||
AllTools = set(ModuleOptions.keys() + PlatformOptions.keys() +
|
||||
PlatformModuleOptions.keys() + ModuleTypeOptions.keys() +
|
||||
self.ToolDefinition.keys())
|
||||
AllTools = set(list(ModuleOptions.keys()) + list(PlatformOptions.keys()) +
|
||||
list(PlatformModuleOptions.keys()) + list(ModuleTypeOptions.keys()) +
|
||||
list(self.ToolDefinition.keys()))
|
||||
BuildOptions = defaultdict(lambda: defaultdict(str))
|
||||
for Tool in AllTools:
|
||||
for Options in [self.ToolDefinition, ModuleOptions, PlatformOptions, ModuleTypeOptions, PlatformModuleOptions]:
|
||||
|
@ -3436,7 +3436,7 @@ class ModuleAutoGen(AutoGen):
|
|||
return None
|
||||
MapFileName = os.path.join(self.OutputDir, self.Name + ".map")
|
||||
EfiFileName = os.path.join(self.OutputDir, self.Name + ".efi")
|
||||
VfrUniOffsetList = GetVariableOffset(MapFileName, EfiFileName, VfrUniBaseName.values())
|
||||
VfrUniOffsetList = GetVariableOffset(MapFileName, EfiFileName, list(VfrUniBaseName.values()))
|
||||
if not VfrUniOffsetList:
|
||||
return None
|
||||
|
||||
|
@ -3521,7 +3521,7 @@ class ModuleAutoGen(AutoGen):
|
|||
Packages = []
|
||||
PcdCheckList = []
|
||||
PcdTokenSpaceList = []
|
||||
for Pcd in self.ModulePcdList + self.LibraryPcdList:
|
||||
for Pcd in list(self.ModulePcdList) + list(self.LibraryPcdList):
|
||||
if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
|
||||
PatchablePcds.append(Pcd)
|
||||
PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS_PATCHABLE_IN_MODULE))
|
||||
|
|
|
@ -936,7 +936,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
|
|||
if Info.IsLibrary:
|
||||
PcdList = Info.LibraryPcdList
|
||||
else:
|
||||
PcdList = Info.ModulePcdList + Info.LibraryPcdList
|
||||
PcdList = list(Info.ModulePcdList) + list(Info.LibraryPcdList)
|
||||
PcdExCNameTest = 0
|
||||
for PcdModule in PcdList:
|
||||
if PcdModule.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenCName == PcdModule.TokenCName:
|
||||
|
@ -970,7 +970,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
|
|||
AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
|
||||
elif Pcd.Type in PCD_DYNAMIC_TYPE_SET:
|
||||
PcdCNameTest = 0
|
||||
for PcdModule in Info.LibraryPcdList + Info.ModulePcdList:
|
||||
for PcdModule in list(Info.LibraryPcdList) + list(Info.ModulePcdList):
|
||||
if PcdModule.Type in PCD_DYNAMIC_TYPE_SET and Pcd.TokenCName == PcdModule.TokenCName:
|
||||
PcdCNameTest += 1
|
||||
# get out early once we found > 1...
|
||||
|
@ -2065,7 +2065,7 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer,
|
|||
if Guid in Info.Module.GetGuidsUsedByPcd():
|
||||
continue
|
||||
GuidMacros.append('#define %s %s' % (Guid, Info.Module.Guids[Guid]))
|
||||
for Guid, Value in Info.Module.Protocols.items() + Info.Module.Ppis.items():
|
||||
for Guid, Value in list(Info.Module.Protocols.items()) + list(Info.Module.Ppis.items()):
|
||||
GuidMacros.append('#define %s %s' % (Guid, Value))
|
||||
# supports FixedAtBuild and FeaturePcd usage in VFR file
|
||||
if Info.VfrFileList and Info.ModulePcdList:
|
||||
|
|
|
@ -668,8 +668,8 @@ cleanlib:
|
|||
"separator" : Separator,
|
||||
"module_tool_definitions" : ToolsDef,
|
||||
|
||||
"shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
|
||||
"shell_command" : self._SHELL_CMD_[self._FileType].values(),
|
||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
||||
|
||||
"module_entry_point" : ModuleEntryPoint,
|
||||
"image_entry_point" : ImageEntryPoint,
|
||||
|
@ -1274,8 +1274,8 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
|
|||
"separator" : Separator,
|
||||
"module_tool_definitions" : ToolsDef,
|
||||
|
||||
"shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
|
||||
"shell_command" : self._SHELL_CMD_[self._FileType].values(),
|
||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
||||
|
||||
"create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
|
||||
"custom_makefile_content" : CustomMakefile
|
||||
|
@ -1448,8 +1448,8 @@ cleanlib:
|
|||
|
||||
"toolchain_tag" : MyAgo.ToolChain,
|
||||
"build_target" : MyAgo.BuildTarget,
|
||||
"shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
|
||||
"shell_command" : self._SHELL_CMD_[self._FileType].values(),
|
||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
||||
"build_architecture_list" : MyAgo.Arch,
|
||||
"architecture" : MyAgo.Arch,
|
||||
"separator" : Separator,
|
||||
|
@ -1584,8 +1584,8 @@ class TopLevelMakefile(BuildFile):
|
|||
|
||||
"toolchain_tag" : MyAgo.ToolChain,
|
||||
"build_target" : MyAgo.BuildTarget,
|
||||
"shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
|
||||
"shell_command" : self._SHELL_CMD_[self._FileType].values(),
|
||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
||||
'arch' : list(MyAgo.ArchList),
|
||||
"build_architecture_list" : ','.join(MyAgo.ArchList),
|
||||
"separator" : Separator,
|
||||
|
|
|
@ -611,7 +611,7 @@ def BuildExDataBase(Dict):
|
|||
DbVardefValueUint32 = DbItemList(4, RawDataList = VardefValueUint32)
|
||||
VpdHeadValue = Dict['VPD_DB_VALUE']
|
||||
DbVpdHeadValue = DbComItemList(4, RawDataList = VpdHeadValue)
|
||||
ExMapTable = zip(Dict['EXMAPPING_TABLE_EXTOKEN'], Dict['EXMAPPING_TABLE_LOCAL_TOKEN'], Dict['EXMAPPING_TABLE_GUID_INDEX'])
|
||||
ExMapTable = list(zip(Dict['EXMAPPING_TABLE_EXTOKEN'], Dict['EXMAPPING_TABLE_LOCAL_TOKEN'], Dict['EXMAPPING_TABLE_GUID_INDEX']))
|
||||
DbExMapTable = DbExMapTblItemList(8, RawDataList = ExMapTable)
|
||||
LocalTokenNumberTable = Dict['LOCAL_TOKEN_NUMBER_DB_VALUE']
|
||||
DbLocalTokenNumberTable = DbItemList(4, RawDataList = LocalTokenNumberTable)
|
||||
|
@ -645,7 +645,7 @@ def BuildExDataBase(Dict):
|
|||
PcdNameOffsetTable = Dict['PCD_NAME_OFFSET']
|
||||
DbPcdNameOffsetTable = DbItemList(4, RawDataList = PcdNameOffsetTable)
|
||||
|
||||
SizeTableValue = zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_TABLE_CURRENT_LENGTH'])
|
||||
SizeTableValue = list(zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_TABLE_CURRENT_LENGTH']))
|
||||
DbSizeTableValue = DbSizeTableItemList(2, RawDataList = SizeTableValue)
|
||||
InitValueUint16 = Dict['INIT_DB_VALUE_UINT16']
|
||||
DbInitValueUint16 = DbComItemList(2, RawDataList = InitValueUint16)
|
||||
|
|
|
@ -552,9 +552,9 @@ def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, Ski
|
|||
#
|
||||
# support ISO 639-2 codes in .UNI files of EDK Shell
|
||||
#
|
||||
Uni = UniFileClassObject(sorted (UniFilList), True, IncludePathList)
|
||||
Uni = UniFileClassObject(sorted (UniFilList, key=lambda x: x.File), True, IncludePathList)
|
||||
else:
|
||||
Uni = UniFileClassObject(sorted (UniFilList), IsCompatibleMode, IncludePathList)
|
||||
Uni = UniFileClassObject(sorted (UniFilList, key=lambda x: x.File), IsCompatibleMode, IncludePathList)
|
||||
else:
|
||||
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 'No unicode files given')
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ import pickle
|
|||
import array
|
||||
import shutil
|
||||
from struct import pack
|
||||
from UserDict import IterableUserDict
|
||||
from UserList import UserList
|
||||
from collections import UserDict as IterableUserDict
|
||||
from collections import OrderedDict
|
||||
|
||||
from Common import EdkLogger as EdkLogger
|
||||
from Common import GlobalData as GlobalData
|
||||
|
@ -654,7 +654,7 @@ def RealPath2(File, Dir='', OverrideDir=''):
|
|||
#
|
||||
def GuidValue(CName, PackageList, Inffile = None):
|
||||
for P in PackageList:
|
||||
GuidKeys = P.Guids.keys()
|
||||
GuidKeys = list(P.Guids.keys())
|
||||
if Inffile and P._PrivateGuids:
|
||||
if not Inffile.startswith(P.MetaFile.Dir):
|
||||
GuidKeys = [x for x in P.Guids if x not in P._PrivateGuids]
|
||||
|
@ -673,7 +673,7 @@ def GuidValue(CName, PackageList, Inffile = None):
|
|||
#
|
||||
def ProtocolValue(CName, PackageList, Inffile = None):
|
||||
for P in PackageList:
|
||||
ProtocolKeys = P.Protocols.keys()
|
||||
ProtocolKeys = list(P.Protocols.keys())
|
||||
if Inffile and P._PrivateProtocols:
|
||||
if not Inffile.startswith(P.MetaFile.Dir):
|
||||
ProtocolKeys = [x for x in P.Protocols if x not in P._PrivateProtocols]
|
||||
|
@ -692,7 +692,7 @@ def ProtocolValue(CName, PackageList, Inffile = None):
|
|||
#
|
||||
def PpiValue(CName, PackageList, Inffile = None):
|
||||
for P in PackageList:
|
||||
PpiKeys = P.Ppis.keys()
|
||||
PpiKeys = list(P.Ppis.keys())
|
||||
if Inffile and P._PrivatePpis:
|
||||
if not Inffile.startswith(P.MetaFile.Dir):
|
||||
PpiKeys = [x for x in P.Ppis if x not in P._PrivatePpis]
|
||||
|
@ -1960,7 +1960,7 @@ class SkuClass():
|
|||
ExtraData = "SKU-ID [%s] value %s exceeds the max value of UINT64"
|
||||
% (SkuName, SkuId))
|
||||
|
||||
self.AvailableSkuIds = sdict()
|
||||
self.AvailableSkuIds = OrderedDict()
|
||||
self.SkuIdSet = []
|
||||
self.SkuIdNumberSet = []
|
||||
self.SkuData = SkuIds
|
||||
|
@ -1970,7 +1970,7 @@ class SkuClass():
|
|||
self.SkuIdSet = ['DEFAULT']
|
||||
self.SkuIdNumberSet = ['0U']
|
||||
elif SkuIdentifier == 'ALL':
|
||||
self.SkuIdSet = SkuIds.keys()
|
||||
self.SkuIdSet = list(SkuIds.keys())
|
||||
self.SkuIdNumberSet = [num[0].strip() + 'U' for num in SkuIds.values()]
|
||||
else:
|
||||
r = SkuIdentifier.split('|')
|
||||
|
|
|
@ -98,7 +98,7 @@ def GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
|
|||
# @retval list() A list for splitted string
|
||||
#
|
||||
def GetSplitList(String, SplitStr=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
|
||||
return map(lambda l: l.strip(), String.split(SplitStr, MaxSplit))
|
||||
return list(map(lambda l: l.strip(), String.split(SplitStr, MaxSplit)))
|
||||
|
||||
## MergeArches
|
||||
#
|
||||
|
@ -544,7 +544,7 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCh
|
|||
#
|
||||
LineList[1] = CleanString(LineList[1], CommentCharacter)
|
||||
if ValueSplitFlag:
|
||||
Value = map(string.strip, LineList[1].split(ValueSplitCharacter))
|
||||
Value = list(map(string.strip, LineList[1].split(ValueSplitCharacter)))
|
||||
else:
|
||||
Value = CleanString(LineList[1], CommentCharacter).splitlines()
|
||||
|
||||
|
@ -750,7 +750,7 @@ def SplitString(String):
|
|||
# @param StringList: A list for strings to be converted
|
||||
#
|
||||
def ConvertToSqlString(StringList):
|
||||
return map(lambda s: s.replace("'", "''"), StringList)
|
||||
return list(map(lambda s: s.replace("'", "''"), StringList))
|
||||
|
||||
## Convert To Sql String
|
||||
#
|
||||
|
|
|
@ -1073,7 +1073,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
|||
def __GetBuildOutputMapFileVfrUniInfo(self, VfrUniBaseName):
|
||||
MapFileName = os.path.join(self.EfiOutputPath, self.BaseName + ".map")
|
||||
EfiFileName = os.path.join(self.EfiOutputPath, self.BaseName + ".efi")
|
||||
return GetVariableOffset(MapFileName, EfiFileName, VfrUniBaseName.values())
|
||||
return GetVariableOffset(MapFileName, EfiFileName, list(VfrUniBaseName.values()))
|
||||
|
||||
## __GenUniVfrOffsetFile() method
|
||||
#
|
||||
|
|
|
@ -1551,7 +1551,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||
del pcd.SkuInfoList[TAB_COMMON]
|
||||
|
||||
map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
|
||||
list(map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType]))
|
||||
return Pcds
|
||||
|
||||
## Retrieve non-dynamic PCD settings
|
||||
|
@ -2505,7 +2505,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||
del pcd.SkuInfoList[TAB_COMMON]
|
||||
|
||||
map(self.FilterSkuSettings, Pcds.values())
|
||||
list(map(self.FilterSkuSettings, Pcds.values()))
|
||||
|
||||
return Pcds
|
||||
|
||||
|
@ -2570,7 +2570,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
PcdObj.SkuInfoList[skuname].SkuId = skuid
|
||||
PcdObj.SkuInfoList[skuname].SkuIdName = skuname
|
||||
if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
|
||||
PcdObj.DefaultValue = PcdObj.SkuInfoList.values()[0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE else PcdObj.SkuInfoList[TAB_DEFAULT].HiiDefaultValue
|
||||
PcdObj.DefaultValue = list(PcdObj.SkuInfoList.values())[0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE else PcdObj.SkuInfoList[TAB_DEFAULT].HiiDefaultValue
|
||||
Pcds[PcdCName, TokenSpaceGuid]= PcdObj
|
||||
return Pcds
|
||||
## Retrieve dynamic HII PCD settings
|
||||
|
@ -2731,7 +2731,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
invalidpcd = ",".join(invalidhii)
|
||||
EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message='The same HII PCD must map to the same EFI variable for all SKUs', File=self.MetaFile, ExtraData=invalidpcd)
|
||||
|
||||
map(self.FilterSkuSettings, Pcds.values())
|
||||
list(map(self.FilterSkuSettings, Pcds.values()))
|
||||
|
||||
return Pcds
|
||||
|
||||
|
@ -2829,7 +2829,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
|
||||
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAULT_STORES_DEFAULT] = InitialValue
|
||||
for pcd in Pcds.values():
|
||||
SkuInfoObj = pcd.SkuInfoList.values()[0]
|
||||
SkuInfoObj = list(pcd.SkuInfoList.values())[0]
|
||||
pcdDecObject = self._DecPcds[pcd.TokenCName, pcd.TokenSpaceGuidCName]
|
||||
pcd.DatumType = pcdDecObject.DatumType
|
||||
# Only fix the value while no value provided in DSC file.
|
||||
|
@ -2847,7 +2847,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
del pcd.SkuInfoList[TAB_COMMON]
|
||||
|
||||
|
||||
map(self.FilterSkuSettings, Pcds.values())
|
||||
list(map(self.FilterSkuSettings, Pcds.values()))
|
||||
return Pcds
|
||||
|
||||
## Add external modules
|
||||
|
|
|
@ -22,7 +22,7 @@ from CommonDataClass.DataClass import FileClass
|
|||
|
||||
## Convert to SQL required string format
|
||||
def ConvertToSqlString(StringList):
|
||||
return map(lambda s: "'" + s.replace("'", "''") + "'", StringList)
|
||||
return list(map(lambda s: "'" + s.replace("'", "''") + "'", StringList))
|
||||
|
||||
## TableFile
|
||||
#
|
||||
|
|
|
@ -600,7 +600,7 @@ class ModuleReport(object):
|
|||
# Collect all module used PCD set: module INF referenced directly or indirectly.
|
||||
# It also saves module INF default values of them in case they exist.
|
||||
#
|
||||
for Pcd in M.ModulePcdList + M.LibraryPcdList:
|
||||
for Pcd in list(M.ModulePcdList) + list(M.LibraryPcdList):
|
||||
self.ModulePcdSet.setdefault((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Type), (Pcd.InfDefaultValue, Pcd.DefaultValue))
|
||||
|
||||
self.LibraryReport = None
|
||||
|
@ -853,7 +853,7 @@ class PcdReport(object):
|
|||
#
|
||||
# Collect module override PCDs
|
||||
#
|
||||
for ModulePcd in Module.M.ModulePcdList + Module.M.LibraryPcdList:
|
||||
for ModulePcd in list(Module.M.ModulePcdList) + list(Module.M.LibraryPcdList):
|
||||
TokenCName = ModulePcd.TokenCName
|
||||
TokenSpaceGuid = ModulePcd.TokenSpaceGuidCName
|
||||
ModuleDefault = ModulePcd.DefaultValue
|
||||
|
@ -1082,9 +1082,9 @@ class PcdReport(object):
|
|||
if not Pcd.SkuInfoList:
|
||||
OverrideValues = Pcd.SkuOverrideValues
|
||||
if OverrideValues:
|
||||
Keys = OverrideValues.keys()
|
||||
Keys = list(OverrideValues.keys())
|
||||
Data = OverrideValues[Keys[0]]
|
||||
Struct = Data.values()[0]
|
||||
Struct = list(Data.values())[0]
|
||||
DscOverride = self.ParseStruct(Struct)
|
||||
else:
|
||||
SkuList = sorted(Pcd.SkuInfoList.keys())
|
||||
|
@ -1101,7 +1101,7 @@ class PcdReport(object):
|
|||
else:
|
||||
OverrideValues = Pcd.SkuOverrideValues[Sku]
|
||||
if OverrideValues:
|
||||
Keys = OverrideValues.keys()
|
||||
Keys = list(OverrideValues.keys())
|
||||
OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
|
||||
DscOverride = self.ParseStruct(OverrideFieldStruct)
|
||||
if DscOverride:
|
||||
|
@ -1256,9 +1256,9 @@ class PcdReport(object):
|
|||
if IsStructure:
|
||||
OverrideValues = Pcd.SkuOverrideValues
|
||||
if OverrideValues:
|
||||
Keys = OverrideValues.keys()
|
||||
Keys = list(OverrideValues.keys())
|
||||
Data = OverrideValues[Keys[0]]
|
||||
Struct = Data.values()[0]
|
||||
Struct = list(Data.values())[0]
|
||||
OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct)
|
||||
self.PrintStructureInfo(File, OverrideFieldStruct)
|
||||
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
|
||||
|
@ -1382,7 +1382,7 @@ class PcdReport(object):
|
|||
if IsStructure:
|
||||
OverrideValues = Pcd.SkuOverrideValues[Sku]
|
||||
if OverrideValues:
|
||||
Keys = OverrideValues.keys()
|
||||
Keys = list(OverrideValues.keys())
|
||||
OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
|
||||
self.PrintStructureInfo(File, OverrideFieldStruct)
|
||||
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
|
||||
|
|
|
@ -503,7 +503,7 @@ class BuildTask:
|
|||
|
||||
# get all pending tasks
|
||||
BuildTask._PendingQueueLock.acquire()
|
||||
BuildObjectList = BuildTask._PendingQueue.keys()
|
||||
BuildObjectList = list(BuildTask._PendingQueue.keys())
|
||||
#
|
||||
# check if their dependency is resolved, and if true, move them
|
||||
# into ready queue
|
||||
|
|
Loading…
Reference in New Issue