InfLowerPath = str(PathClassObj).lower()\r
if self.OverrideGuid:\r
PathClassObj = ProcessDuplicatedInf(PathClassObj, self.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir)\r
- if self.CurrentArch != None:\r
+ if self.CurrentArch is not None:\r
\r
Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
#\r
self.BaseName = Inf.BaseName\r
self.ModuleGuid = Inf.Guid\r
self.ModuleType = Inf.ModuleType\r
- if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:\r
+ if Inf.Specification is not None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:\r
self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']\r
if Inf.AutoGenVersion < 0x00010005:\r
self.ModuleType = Inf.ComponentType\r
self.VersionString = Inf.Version\r
self.BinFileList = Inf.Binaries\r
self.SourceFileList = Inf.Sources\r
- if self.KeepReloc == None and Inf.Shadow:\r
+ if self.KeepReloc is None and Inf.Shadow:\r
self.ShadowFromInfFile = Inf.Shadow\r
\r
else:\r
self.BaseName = Inf.BaseName\r
self.ModuleGuid = Inf.Guid\r
self.ModuleType = Inf.ModuleType\r
- if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:\r
+ if Inf.Specification is not None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:\r
self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']\r
self.VersionString = Inf.Version\r
self.BinFileList = Inf.Binaries\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
# 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
#\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
CurrentArch.upper() + \\r
'.' + \\r
self.ModuleType.upper()\r
- if self.Rule != None:\r
+ if self.Rule is not None:\r
RuleName = RuleName + \\r
'.' + \\r
self.Rule.upper()\r
\r
Rule = GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(RuleName)\r
- if Rule != None:\r
+ if Rule is not None:\r
GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Name is : " + RuleName)\r
return Rule\r
\r
'.' + \\r
self.ModuleType.upper()\r
\r
- if self.Rule != None:\r
+ if self.Rule is not None:\r
RuleName = RuleName + \\r
'.' + \\r
self.Rule.upper()\r
GenFdsGlobalVariable.VerboseLogger ('Trying to apply common rule %s for INF %s' % (RuleName, self.InfFileName))\r
\r
Rule = GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(RuleName)\r
- if Rule != None:\r
+ if Rule is not None:\r
GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Name is : " + RuleName)\r
return Rule\r
\r
- if Rule == None :\r
+ if Rule is None :\r
EdkLogger.error("GenFds", GENFDS_ERROR, 'Don\'t Find common rule %s for INF %s' \\r
% (RuleName, self.InfFileName))\r
\r
DscArchList = []\r
for Arch in GenFdsGlobalVariable.ArchList :\r
PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
- if PlatformDataBase != None:\r
+ if PlatformDataBase is not None:\r
if InfFileKey in PlatformDataBase.Modules:\r
DscArchList.append (Arch)\r
else:\r
ArchList = CurArchList\r
\r
UseArchList = TargetArchList\r
- if self.UseArch != None:\r
+ if self.UseArch is not None:\r
UseArchList = []\r
UseArchList.append(self.UseArch)\r
ArchList = list(set (UseArchList) & set (ArchList))\r
if self.OverrideGuid:\r
FileName = self.OverrideGuid\r
Arch = "NoneArch"\r
- if self.CurrentArch != None:\r
+ if self.CurrentArch is not None:\r
Arch = self.CurrentArch\r
\r
OutputPath = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch],\r
FileList = []\r
OutputFileList = []\r
GenSecInputFile = None\r
- if Rule.FileName != None:\r
+ if Rule.FileName is not None:\r
GenSecInputFile = self.__ExtendMacro__(Rule.FileName)\r
if os.path.isabs(GenSecInputFile):\r
GenSecInputFile = os.path.normpath(GenSecInputFile)\r
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)\r
NoStrip = True\r
if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):\r
- if self.KeepReloc != None:\r
+ if self.KeepReloc is not None:\r
NoStrip = self.KeepReloc\r
- elif Rule.KeepReloc != None:\r
+ elif Rule.KeepReloc is not None:\r
NoStrip = Rule.KeepReloc\r
- elif self.ShadowFromInfFile != None:\r
+ elif self.ShadowFromInfFile is not None:\r
NoStrip = self.ShadowFromInfFile\r
\r
if FileList != [] :\r
InputSection.append(InputFile)\r
SectionAlignments.append(Rule.SectAlignment)\r
\r
- if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):\r
+ if Rule.NameGuid is not None and Rule.NameGuid.startswith('PCD('):\r
PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)\r
if len(PcdValue) == 0:\r
EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \\r
#\r
def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr, IsMakefile = False):\r
if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):\r
- if Rule.KeepReloc != None:\r
+ if Rule.KeepReloc is not None:\r
self.KeepRelocFromRule = Rule.KeepReloc\r
SectFiles = []\r
SectAlignments = []\r
Sect.FvAddr = FvChildAddr.pop(0)\r
elif isinstance(Sect, GuidSection):\r
Sect.FvAddr = FvChildAddr\r
- if FvParentAddr != None and isinstance(Sect, GuidSection):\r
+ if FvParentAddr is not None and isinstance(Sect, GuidSection):\r
Sect.FvParentAddr = FvParentAddr\r
\r
if Rule.KeyStringList != []:\r
#\r
def __GenComplexFileFfs__(self, Rule, InputFile, Alignments, MakefilePath = None):\r
\r
- if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):\r
+ if Rule.NameGuid is not None and Rule.NameGuid.startswith('PCD('):\r
PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)\r
if len(PcdValue) == 0:\r
EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \\r
if Rule.CheckSum != False:\r
result += ('-s',)\r
\r
- if Rule.Alignment != None and Rule.Alignment != '':\r
+ if Rule.Alignment is not None and Rule.Alignment != '':\r
result += ('-a', Rule.Alignment)\r
\r
return result\r