for Module in Pa.ModuleAutoGenList:\r
if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):\r
InfFoundFlag = True\r
- if not Module.Guid.upper() in _GuidDict.keys():\r
+ if Module.Guid.upper() not in _GuidDict:\r
_GuidDict[Module.Guid.upper()] = FfsFile\r
break\r
else:\r
# BuildObject from one of AutoGenObjectList is enough.\r
#\r
InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, TAB_COMMON, self.BuildTarget, self.ToolChain]\r
- if not InfObj.Guid.upper() in _GuidDict.keys():\r
+ if InfObj.Guid.upper() not in _GuidDict:\r
_GuidDict[InfObj.Guid.upper()] = FfsFile\r
else:\r
EdkLogger.error("build",\r
"The format of PCD value is incorrect. PCD: %s , Value: %s\n" % (_PcdName, PcdItem.DefaultValue),\r
ExtraData=self.FdfFile)\r
\r
- if not _PcdGuidString.upper() in _GuidDict.keys():\r
+ if _PcdGuidString.upper() not in _GuidDict:\r
_GuidDict[_PcdGuidString.upper()] = FfsFile\r
PcdFoundFlag = True\r
break\r
FfsFile.NameGuid.upper()),\r
ExtraData=self.FdfFile)\r
\r
- if not FfsFile.NameGuid.upper() in _GuidDict.keys():\r
+ if FfsFile.NameGuid.upper() not in _GuidDict:\r
_GuidDict[FfsFile.NameGuid.upper()] = FfsFile\r
else:\r
#\r
\r
for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
\r
# Check the PCD from Binary INF or Source INF\r
PcdFromModule.IsFromBinaryInf = True\r
\r
# Check the PCD from DSC or not \r
- if (PcdFromModule.TokenCName, PcdFromModule.TokenSpaceGuidCName) in self.Platform.Pcds.keys():\r
- PcdFromModule.IsFromDsc = True\r
- else:\r
- PcdFromModule.IsFromDsc = False\r
+ PcdFromModule.IsFromDsc = (PcdFromModule.TokenCName, PcdFromModule.TokenSpaceGuidCName) in self.Platform.Pcds\r
+\r
if PcdFromModule.Type in GenC.gDynamicPcd or PcdFromModule.Type in GenC.gDynamicExPcd:\r
if F.Path not in FdfModuleList:\r
# If one of the Source built modules listed in the DSC is not listed \r
ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
% (PcdFromModule.Type, PcdFromModule.TokenCName, InfName))\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
if M.ModuleType in ["PEIM", "PEI_CORE"]:\r
PcdFromModule.Phase = "PEI"\r
VpdFile = VpdInfoFile.VpdInfoFile()\r
NeedProcessVpdMapFile = False\r
\r
- for pcd in self.Platform.Pcds.keys():\r
- if pcd not in self._PlatformPcds.keys():\r
+ for pcd in self.Platform.Pcds:\r
+ if pcd not in self._PlatformPcds:\r
self._PlatformPcds[pcd] = self.Platform.Pcds[pcd]\r
\r
for item in self._PlatformPcds:\r
if self._PlatformPcds[item].DatumType and self._PlatformPcds[item].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
- self._PlatformPcds[item].DatumType = "VOID*"\r
+ self._PlatformPcds[item].DatumType = TAB_VOID\r
\r
if (self.Workspace.ArchList[-1] == self.Arch): \r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
- Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]\r
+ Sku = Pcd.SkuInfoList.values()[0]\r
Sku.VpdOffset = Sku.VpdOffset.strip()\r
\r
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
- Pcd.DatumType = "VOID*"\r
+ Pcd.DatumType = TAB_VOID\r
\r
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
# if found HII type PCD then insert to right of UnicodeIndex\r
if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:\r
if not (self.Platform.VpdToolGuid is None or self.Platform.VpdToolGuid == ''):\r
FoundFlag = False\r
- for VpdPcd in VpdFile._VpdArray.keys():\r
+ for VpdPcd in VpdFile._VpdArray:\r
# This PCD has been referenced by module\r
if (VpdPcd.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \\r
(VpdPcd.TokenCName == DscPcdEntry.TokenCName):\r
SkuValueMap[PcdValue].append(Sku)\r
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
NeedProcessVpdMapFile = True \r
- if DscPcdEntry.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
+ if DscPcdEntry.DatumType == TAB_VOID and PcdValue.startswith("L"):\r
UnicodePcdArray.add(DscPcdEntry)\r
elif len(Sku.VariableName) > 0:\r
HiiPcdArray.add(DscPcdEntry)\r
# Delete the DynamicPcdList At the last time enter into this function\r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
- Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]\r
+ Sku = Pcd.SkuInfoList.values()[0]\r
Sku.VpdOffset = Sku.VpdOffset.strip()\r
\r
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
- Pcd.DatumType = "VOID*"\r
+ Pcd.DatumType = TAB_VOID\r
\r
PcdValue = Sku.DefaultValue\r
- if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
+ if Pcd.DatumType == TAB_VOID and PcdValue.startswith("L"):\r
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
UnicodePcdArray.add(Pcd)\r
elif len(Sku.VariableName) > 0:\r
ToPcd.validlists = FromPcd.validlists\r
ToPcd.expressions = FromPcd.expressions\r
\r
- if FromPcd is not None and ToPcd.DatumType == "VOID*" and ToPcd.MaxDatumSize in ['', None]:\r
+ if FromPcd is not None and ToPcd.DatumType == TAB_VOID and ToPcd.MaxDatumSize in ['', None]:\r
EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \\r
% (ToPcd.TokenSpaceGuidCName, TokenCName))\r
Value = ToPcd.DefaultValue\r
# use PCD value to calculate the MaxDatumSize when it is not specified\r
for Name, Guid in Pcds:\r
Pcd = Pcds[Name, Guid]\r
- if Pcd.DatumType == "VOID*" and Pcd.MaxDatumSize in ['', None]:\r
+ if Pcd.DatumType == TAB_VOID and Pcd.MaxDatumSize in ['', None]:\r
Pcd.MaxSizeUserSet = None\r
Value = Pcd.DefaultValue\r
if Value in [None, '']:\r
for LibraryName in M.Libraries:\r
Library = self.Platform.LibraryClasses[LibraryName, ':dummy:']\r
if Library is None:\r
- for Key in self.Platform.LibraryClasses.data.keys():\r
+ for Key in self.Platform.LibraryClasses.data:\r
if LibraryName.upper() == Key.upper():\r
Library = self.Platform.LibraryClasses[Key, ':dummy:']\r
break\r
InfObj = InfSectionParser.InfSectionParser(Filename)\r
DepexExpresionList = InfObj.GetDepexExpresionList()\r
for DepexExpresion in DepexExpresionList:\r
- for key in DepexExpresion.keys():\r
+ for key in DepexExpresion:\r
Arch, ModuleType = key\r
DepexExpr = [x for x in DepexExpresion[key] if not str(x).startswith('#')]\r
# the type of build module is USER_DEFINED.\r
#the type of build module is USER_DEFINED.\r
if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:\r
for Depex in DepexList:\r
- for key in Depex.keys():\r
+ for key in Depex:\r
DepexStr += '[Depex.%s.%s]\n' % key\r
DepexStr += '\n'.join(['# '+ val for val in Depex[key]])\r
DepexStr += '\n\n'\r
InfObj = InfSectionParser.InfSectionParser(Filename)\r
TianoCoreUserExtenList = InfObj.GetUserExtensionTianoCore()\r
for TianoCoreUserExtent in TianoCoreUserExtenList:\r
- for Section in TianoCoreUserExtent.keys():\r
+ for Section in TianoCoreUserExtent:\r
ItemList = Section.split(TAB_SPLIT)\r
Arch = self.Arch\r
if len(ItemList) == 4:\r
elif BoolValue == 'FALSE':\r
Pcd.DefaultValue = '0'\r
\r
- if Pcd.DatumType in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:\r
+ if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES:\r
HexFormat = '0x%02x'\r
- if Pcd.DatumType == 'UINT16':\r
+ if Pcd.DatumType == TAB_UINT16:\r
HexFormat = '0x%04x'\r
- elif Pcd.DatumType == 'UINT32':\r
+ elif Pcd.DatumType == TAB_UINT32:\r
HexFormat = '0x%08x'\r
- elif Pcd.DatumType == 'UINT64':\r
+ elif Pcd.DatumType == TAB_UINT64:\r
HexFormat = '0x%016x'\r
PcdValue = HexFormat % int(Pcd.DefaultValue, 0)\r
else:\r