#\r
def AddToBuffer (self, Buffer, BaseAddress=None, BlockSize= None, BlockNum=None, ErasePloarity='1', VtfDict=None, MacroDict = {}, Flag=False) :\r
\r
- if BaseAddress == None and self.UiFvName.upper() + 'fv' in GenFds.ImageBinDict.keys():\r
+ if BaseAddress is None and self.UiFvName.upper() + 'fv' in GenFds.ImageBinDict.keys():\r
return GenFds.ImageBinDict[self.UiFvName.upper() + 'fv']\r
\r
#\r
# Check whether FV in Capsule is in FD flash region.\r
# If yes, return error. Doesn't support FV in Capsule image is also in FD flash region.\r
#\r
- if self.CapsuleName != None:\r
+ if self.CapsuleName is not None:\r
for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]\r
for RegionObj in FdObj.RegionList:\r
GenFdsGlobalVariable.LargeFileInFvFlags.append(False)\r
FFSGuid = None\r
\r
- if self.FvBaseAddress != None:\r
+ if self.FvBaseAddress is not None:\r
BaseAddress = self.FvBaseAddress\r
if not Flag:\r
self.__InitializeInf__(BaseAddress, BlockSize, BlockNum, ErasePloarity, VtfDict)\r
FvOutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiFvName)\r
FvOutputFile = FvOutputFile + '.Fv'\r
# BUGBUG: FvOutputFile could be specified from FDF file (FV section, CreateFile statement)\r
- if self.CreateFileName != None:\r
+ if self.CreateFileName is not None:\r
FvOutputFile = self.CreateFileName\r
\r
if Flag:\r
NewFvInfo = None\r
if os.path.exists (FvInfoFileName):\r
NewFvInfo = open(FvInfoFileName, 'r').read()\r
- if NewFvInfo != None and NewFvInfo != OrigFvInfo:\r
+ if NewFvInfo is not None and NewFvInfo != OrigFvInfo:\r
FvChildAddr = []\r
AddFileObj = open(FvInfoFileName, 'r')\r
AddrStrings = AddFileObj.readlines()\r
# Add [Options]\r
#\r
self.FvInfFile.writelines("[options]" + T_CHAR_LF)\r
- if BaseAddress != None :\r
+ if BaseAddress is not None :\r
self.FvInfFile.writelines("EFI_BASE_ADDRESS = " + \\r
BaseAddress + \\r
T_CHAR_LF)\r
\r
- if BlockSize != None:\r
+ if BlockSize is not None:\r
self.FvInfFile.writelines("EFI_BLOCK_SIZE = " + \\r
'0x%X' %BlockSize + \\r
T_CHAR_LF)\r
- if BlockNum != None:\r
+ if BlockNum is not None:\r
self.FvInfFile.writelines("EFI_NUM_BLOCKS = " + \\r
' 0x%X' %BlockNum + \\r
T_CHAR_LF)\r
self.FvInfFile.writelines("EFI_BLOCK_SIZE = 0x1" + T_CHAR_LF)\r
\r
for BlockSize in self.BlockSizeList :\r
- if BlockSize[0] != None:\r
+ if BlockSize[0] is not None:\r
self.FvInfFile.writelines("EFI_BLOCK_SIZE = " + \\r
'0x%X' %BlockSize[0] + \\r
T_CHAR_LF)\r
\r
- if BlockSize[1] != None:\r
+ if BlockSize[1] is not None:\r
self.FvInfFile.writelines("EFI_NUM_BLOCKS = " + \\r
' 0x%X' %BlockSize[1] + \\r
T_CHAR_LF)\r
\r
- if self.BsBaseAddress != None:\r
+ if self.BsBaseAddress is not None:\r
self.FvInfFile.writelines('EFI_BOOT_DRIVER_BASE_ADDRESS = ' + \\r
'0x%X' %self.BsBaseAddress)\r
- if self.RtBaseAddress != None:\r
+ if self.RtBaseAddress is not None:\r
self.FvInfFile.writelines('EFI_RUNTIME_DRIVER_BASE_ADDRESS = ' + \\r
'0x%X' %self.RtBaseAddress)\r
#\r
self.FvInfFile.writelines("EFI_ERASE_POLARITY = " + \\r
' %s' %ErasePloarity + \\r
T_CHAR_LF)\r
- if not (self.FvAttributeDict == None):\r
+ if not (self.FvAttributeDict is None):\r
for FvAttribute in self.FvAttributeDict.keys() :\r
if FvAttribute == "FvUsedSizeEnable":\r
if self.FvAttributeDict[FvAttribute].upper() in ('TRUE', '1') :\r
' = ' + \\r
self.FvAttributeDict[FvAttribute] + \\r
T_CHAR_LF )\r
- if self.FvAlignment != None:\r
+ if self.FvAlignment is not None:\r
self.FvInfFile.writelines("EFI_FVB2_ALIGNMENT_" + \\r
self.FvAlignment.strip() + \\r
" = TRUE" + \\r
#\r
# Generate FV extension header file\r
#\r
- if self.FvNameGuid == None or self.FvNameGuid == '':\r
+ if self.FvNameGuid is None or self.FvNameGuid == '':\r
if len(self.FvExtEntryType) > 0 or self.UsedSizeEnable:\r
GenFdsGlobalVariable.ErrorLogger("FV Extension Header Entries declared for %s with no FvNameGuid declaration." % (self.UiFvName))\r
\r
# Add [Files]\r
#\r
self.FvInfFile.writelines("[files]" + T_CHAR_LF)\r
- if VtfDict != None and self.UiFvName in VtfDict.keys():\r
+ if VtfDict is not None and self.UiFvName in VtfDict.keys():\r
self.FvInfFile.writelines("EFI_FILE_NAME = " + \\r
VtfDict.get(self.UiFvName) + \\r
T_CHAR_LF)\r