# if the offset of a VPD is *, then it need to be fixed up by third party tool.\r
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
NeedProcessVpdMapFile = True\r
# if the offset of a VPD is *, then it need to be fixed up by third party tool.\r
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
NeedProcessVpdMapFile = True\r
- if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':\r
+ if self.Platform.VpdToolGuid is None or self.Platform.VpdToolGuid == '':\r
EdkLogger.error("Build", FILE_NOT_FOUND, \\r
"Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
\r
EdkLogger.error("Build", FILE_NOT_FOUND, \\r
"Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
@@ -106,7+106,7 @@ class IdfFileClassObject(object):
if Len == 4 and LineDetails[2] != 'TRANSPARENT':\r
EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency setting in Line %s of File %s.' % (LineNo, File.Path))\r
if Len == 4 and LineDetails[2] != 'TRANSPARENT':\r
EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency setting in Line %s of File %s.' % (LineNo, File.Path))\r
- if MatchString == None or MatchString.end(0) != len(LineDetails[1]):\r
+ if MatchString is None or MatchString.end(0) != len(LineDetails[1]):\r
EdkLogger.error('Image Definition File Parser', FORMAT_INVALID, 'The Image token name %s defined in Idf file %s contains the invalid character.' % (LineDetails[1], File.Path))\r
if LineDetails[1] not in self.ImageIDList:\r
self.ImageIDList.append(LineDetails[1])\r
EdkLogger.error('Image Definition File Parser', FORMAT_INVALID, 'The Image token name %s defined in Idf file %s contains the invalid character.' % (LineDetails[1], File.Path))\r
- if MatchString == None or MatchString.end(0) != len(Name):\r
+ if MatchString is None or MatchString.end(0) != len(Name):\r
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
LanguageList = Item.split(u'#language ')\r
for IndexI in range(len(LanguageList)):\r
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
LanguageList = Item.split(u'#language ')\r
for IndexI in range(len(LanguageList)):\r
@@ -466,7+466,7 @@ class UniFileClassObject(object):
# Load a .uni file\r
#\r
def LoadUniFile(self, File = None):\r
# Load a .uni file\r
#\r
def LoadUniFile(self, File = None):\r
- if File == None:\r
+ if File is None:\r
EdkLogger.error("Unicode File Parser", PARSER_ERROR, 'No unicode file is given')\r
self.File = File\r
#\r
EdkLogger.error("Unicode File Parser", PARSER_ERROR, 'No unicode file is given')\r
self.File = File\r
#\r
@@ -522,7+522,7 @@ class UniFileClassObject(object):
- if MatchString == None or MatchString.end(0) != len(Name):\r
+ if MatchString is None or MatchString.end(0) != len(Name):\r
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
self.AddStringToList(Name, Language, Value)\r
continue\r
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
self.AddStringToList(Name, Language, Value)\r
continue\r
@@ -578,7+578,7 @@ class UniFileClassObject(object):
- if (self.__IsHex(Value) or Value.isdigit()) and (self.__IsHex(Profile.MacroValue) or (Profile.MacroValue != None and Profile.MacroValue.isdigit())):\r
+ if (self.__IsHex(Value) or Value.isdigit()) and (self.__IsHex(Profile.MacroValue) or (Profile.MacroValue is not None and Profile.MacroValue.isdigit())):\r
- if Obj.KeepReloc != None and Obj.KeepReloc != EfiSectionObj.KeepReloc:\r
+ if Obj.KeepReloc is not None and Obj.KeepReloc != EfiSectionObj.KeepReloc:\r
raise Warning("Section type %s has reloc strip flag conflict with Rule At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
else:\r
raise Warning("Section type %s could not have reloc strip flag At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
raise Warning("Section type %s has reloc strip flag conflict with Rule At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
else:\r
raise Warning("Section type %s could not have reloc strip flag At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
@@ -231,7+231,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
if self.ModuleType == 'MM_CORE_STANDALONE' and int(self.PiSpecVersion, 16) < 0x00010032:\r
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.InfFileName)\r
\r
if self.ModuleType == 'MM_CORE_STANDALONE' and int(self.PiSpecVersion, 16) < 0x00010032:\r
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.InfFileName)\r
\r
- if Inf._Defs != None and len(Inf._Defs) > 0:\r
+ if Inf._Defs is not None and len(Inf._Defs) > 0:\r
self.OptRomDefs.update(Inf._Defs)\r
\r
self.PatchPcds = []\r
self.OptRomDefs.update(Inf._Defs)\r
\r
self.PatchPcds = []\r
@@ -476,7+476,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
# Allow binary type module not specify override rule in FDF file.\r
# \r
if len(self.BinFileList) > 0:\r
# Allow binary type module not specify override rule in FDF file.\r
# \r
if len(self.BinFileList) > 0:\r
- if self.Rule == None or self.Rule == "":\r
+ if self.Rule is None or self.Rule == "":\r
self.Rule = "BINARY"\r
\r
if not IsMakefile and GenFdsGlobalVariable.EnableGenfdsMultiThread and self.Rule != 'BINARY':\r
self.Rule = "BINARY"\r
\r
if not IsMakefile and GenFdsGlobalVariable.EnableGenfdsMultiThread and self.Rule != 'BINARY':\r
@@ -545,7+545,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
#\r
def __GetRule__ (self) :\r
CurrentArchList = []\r
#\r
def __GetRule__ (self) :\r
CurrentArchList = []\r
- if self.CurrentArch == None:\r
+ if self.CurrentArch is None:\r
CurrentArchList = ['common']\r
else:\r
CurrentArchList.append(self.CurrentArch)\r
CurrentArchList = ['common']\r
else:\r
CurrentArchList.append(self.CurrentArch)\r
@@ -556,13+556,13 @@ class FfsInfStatement(FfsInfStatementClassObject):
@@ -116,17+116,17 @@ class Section (SectionClassObject):
else :\r
IsSect = False\r
\r
else :\r
IsSect = False\r
\r
- if FileExtension != None:\r
+ if FileExtension is not None:\r
Suffix = FileExtension\r
elif IsSect :\r
Suffix = Section.SectionType.get(FileType)\r
else:\r
Suffix = Section.BinFileType.get(FileType)\r
Suffix = FileExtension\r
elif IsSect :\r
Suffix = Section.SectionType.get(FileType)\r
else:\r
Suffix = Section.BinFileType.get(FileType)\r
- if FfsInf == None:\r
+ if FfsInf is None:\r
EdkLogger.error("GenFds", GENFDS_ERROR, 'Inf File does not exist!')\r
\r
FileList = []\r
EdkLogger.error("GenFds", GENFDS_ERROR, 'Inf File does not exist!')\r
\r
FileList = []\r
- if FileType != None:\r
+ if FileType is not None:\r
for File in FfsInf.BinFileList:\r
if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:\r
if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \\r
for File in FfsInf.BinFileList:\r
if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:\r
if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \\r
@@ -141,7+141,7 @@ class Section (SectionClassObject):
else:\r
GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
\r
else:\r
GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
\r
- if (not IsMakefile and Suffix != None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix != None):\r
+ if (not IsMakefile and Suffix is not None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not None):\r
if pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
- if StructPattern.match(pcd.DatumType) == None:\r
+ if StructPattern.match(pcd.DatumType) is None:\r
EdkLogger.error('build', FORMAT_INVALID, "DatumType only support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct name.", pcd.DefinitionPosition[0],pcd.DefinitionPosition[1])\r
for struct_pcd in Pcds.values():\r
if isinstance(struct_pcd,StructurePcd) and not struct_pcd.StructuredPcdIncludeFile:\r
EdkLogger.error('build', FORMAT_INVALID, "DatumType only support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct name.", pcd.DefinitionPosition[0],pcd.DefinitionPosition[1])\r
for struct_pcd in Pcds.values():\r
if isinstance(struct_pcd,StructurePcd) and not struct_pcd.StructuredPcdIncludeFile:\r
@@ -329,10+329,10 @@ class InfBuildData(ModuleBuildClassObject):
EdkLogger.error("build", FORMAT_NOT_SUPPORTED,\r
"MODULE_TYPE %s is not supported for EDK II, valid values are:\n %s" % (self._ModuleType, ' '.join(l for l in SUP_MODULE_LIST)),\r
File=self.MetaFile, Line=LineNo)\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED,\r
"MODULE_TYPE %s is not supported for EDK II, valid values are:\n %s" % (self._ModuleType, ' '.join(l for l in SUP_MODULE_LIST)),\r
File=self.MetaFile, Line=LineNo)\r
- if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):\r
+ if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):\r
if self._ModuleType == SUP_MODULE_SMM_CORE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)\r
if self._ModuleType == SUP_MODULE_SMM_CORE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)\r
- if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x00010032):\r
+ if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x00010032):\r
if self._ModuleType == SUP_MODULE_MM_CORE_STANDALONE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
if self._ModuleType == SUP_MODULE_MM_STANDALONE:\r
if self._ModuleType == SUP_MODULE_MM_CORE_STANDALONE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
if self._ModuleType == SUP_MODULE_MM_STANDALONE:\r
@@ -357,7+357,7 @@ class InfBuildData(ModuleBuildClassObject):