mirror of https://github.com/acidanthera/audk.git
BaseTools: the list and iterator translation
In python3,The keys of the dictionary not a list,It needs to be converted Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
parent
7fa0e68afd
commit
f8d11e5a4a
|
@ -929,7 +929,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) :
|
||||
|
@ -975,7 +975,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) :
|
||||
|
@ -1300,7 +1300,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)
|
||||
|
||||
|
@ -1499,7 +1499,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 = Pcd.SkuInfoList.get(TAB_DEFAULT)
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
|
@ -1605,7 +1605,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))
|
||||
|
@ -1631,7 +1631,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)
|
||||
|
@ -1713,7 +1713,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 = Pcd.SkuInfoList.get(TAB_DEFAULT)
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
|
@ -2286,7 +2286,7 @@ class PlatformAutoGen(AutoGen):
|
|||
Pcd.MaxDatumSize = str(len(Value.split(',')))
|
||||
else:
|
||||
Pcd.MaxDatumSize = str(len(Value) - 1)
|
||||
return Pcds.values()
|
||||
return list(Pcds.values())
|
||||
|
||||
|
||||
|
||||
|
@ -2355,7 +2355,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("_")
|
||||
|
@ -2473,9 +2473,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]:
|
||||
|
@ -3519,7 +3519,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
|
||||
|
||||
|
|
|
@ -2050,7 +2050,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:
|
||||
|
|
|
@ -675,8 +675,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,
|
||||
|
@ -1275,8 +1275,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
|
||||
|
@ -1449,8 +1449,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,
|
||||
|
@ -1581,8 +1581,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,
|
||||
|
|
|
@ -615,7 +615,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)
|
||||
|
@ -649,7 +649,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)
|
||||
|
|
|
@ -551,9 +551,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')
|
||||
|
||||
|
|
|
@ -574,13 +574,14 @@ def RealPath(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]
|
||||
if CName in GuidKeys:
|
||||
return P.Guids[CName]
|
||||
return None
|
||||
return None
|
||||
|
||||
## A string template class
|
||||
#
|
||||
|
@ -1637,7 +1638,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('|')
|
||||
|
|
|
@ -99,7 +99,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
|
||||
#
|
||||
|
@ -545,7 +545,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()
|
||||
|
||||
|
@ -751,7 +751,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
|
||||
#
|
||||
|
|
|
@ -1075,7 +1075,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
|
||||
#
|
||||
|
|
|
@ -1606,7 +1606,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((self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType]))
|
||||
return Pcds
|
||||
@cached_property
|
||||
def PlatformUsedPcds(self):
|
||||
|
@ -2560,7 +2560,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
if BuildOptions:
|
||||
ArchBuildOptions = {arch:flags for arch,flags in BuildOptions.items() if arch != 'COMMON'}
|
||||
if len(ArchBuildOptions.keys()) == 1:
|
||||
BuildOptions['COMMON'] |= (ArchBuildOptions.values()[0])
|
||||
BuildOptions['COMMON'] |= (list(ArchBuildOptions.values())[0])
|
||||
elif len(ArchBuildOptions.keys()) > 1:
|
||||
CommonBuildOptions = reduce(lambda x,y: x&y, ArchBuildOptions.values())
|
||||
BuildOptions['COMMON'] |= CommonBuildOptions
|
||||
|
@ -2778,7 +2778,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
|
||||
|
||||
|
@ -2843,7 +2843,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
|
||||
|
@ -2964,7 +2964,6 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
|
||||
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][DefaultStore] = DefaultValue
|
||||
for pcd in Pcds.values():
|
||||
SkuInfoObj = 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.
|
||||
|
@ -2975,6 +2974,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
sku.DefaultStoreDict[default_store]=pcdDecObject.DefaultValue
|
||||
pcd.DefaultValue = pcdDecObject.DefaultValue
|
||||
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pcd.SkuInfoList:
|
||||
SkuInfoObj = list(pcd.SkuInfoList.values())[0]
|
||||
valuefromDec = pcdDecObject.DefaultValue
|
||||
SkuInfo = SkuInfoClass(TAB_DEFAULT, '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec, VariableAttribute=SkuInfoObj.VariableAttribute, DefaultStore={DefaultStore:valuefromDec})
|
||||
pcd.SkuInfoList[TAB_DEFAULT] = SkuInfo
|
||||
|
@ -3004,7 +3004,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
|
||||
|
||||
|
@ -3102,7 +3102,6 @@ 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]
|
||||
pcdDecObject = self._DecPcds[pcd.TokenCName, pcd.TokenSpaceGuidCName]
|
||||
pcd.DatumType = pcdDecObject.DatumType
|
||||
# Only fix the value while no value provided in DSC file.
|
||||
|
@ -3110,6 +3109,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
if not sku.DefaultValue:
|
||||
sku.DefaultValue = pcdDecObject.DefaultValue
|
||||
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pcd.SkuInfoList:
|
||||
SkuInfoObj = list(pcd.SkuInfoList.values())[0]
|
||||
valuefromDec = pcdDecObject.DefaultValue
|
||||
SkuInfo = SkuInfoClass(TAB_DEFAULT, '0', '', '', '', '', SkuInfoObj.VpdOffset, valuefromDec)
|
||||
pcd.SkuInfoList[TAB_DEFAULT] = SkuInfo
|
||||
|
@ -3129,7 +3129,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
for sku in pcd.SkuInfoList.values():
|
||||
sku.DefaultValue = StringToArray(sku.DefaultValue) if sku.DefaultValue.startswith(('L"',"L'")) else sku.DefaultValue
|
||||
|
||||
map(self.FilterSkuSettings, Pcds.values())
|
||||
list(map(self.FilterSkuSettings, Pcds.values()))
|
||||
return Pcds
|
||||
|
||||
## Add external modules
|
||||
|
|
|
@ -32,7 +32,7 @@ from Workspace.BuildClassObject import ModuleBuildClassObject, LibraryClassObjec
|
|||
#
|
||||
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]
|
||||
|
@ -51,7 +51,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]
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -1209,7 +1209,7 @@ class PcdReport(object):
|
|||
def ParseStruct(self, struct):
|
||||
HasDscOverride = False
|
||||
if struct:
|
||||
for _, Values in struct.items():
|
||||
for _, Values in list(struct.items()):
|
||||
for Key, value in Values.items():
|
||||
if value[1] and value[1].endswith('.dsc'):
|
||||
HasDscOverride = True
|
||||
|
@ -1425,7 +1425,7 @@ class PcdReport(object):
|
|||
FiledOverrideFlag = False
|
||||
OverrideValues = Pcd.SkuOverrideValues[Sku]
|
||||
if OverrideValues:
|
||||
Keys = OverrideValues.keys()
|
||||
Keys = list(OverrideValues.keys())
|
||||
OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
|
||||
self.PrintStructureInfo(File, OverrideFieldStruct)
|
||||
FiledOverrideFlag = True
|
||||
|
|
|
@ -443,7 +443,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