## @file\r
# process FD Region generation\r
#\r
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
from Common.BuildToolError import *\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+from Common.DataType import BINARY_FILE_TYPE_FV\r
\r
## generate Region\r
#\r
GenFdsGlobalVariable.InfLogger('\nGenerate Region at Offset 0x%X' % self.Offset)\r
GenFdsGlobalVariable.InfLogger(" Region Size = 0x%X" % Size)\r
GenFdsGlobalVariable.SharpCounter = 0\r
- if Flag and (self.RegionType != 'FV'):\r
+ if Flag and (self.RegionType != BINARY_FILE_TYPE_FV):\r
return\r
\r
- if self.RegionType == 'FV':\r
+ if self.RegionType == BINARY_FILE_TYPE_FV:\r
#\r
# Get Fv from FvDict\r
#\r
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)\r
\r
FileName = RegionData\r
- elif RegionData.upper() + 'fv' in ImageBinDict.keys():\r
+ elif RegionData.upper() + 'fv' in ImageBinDict:\r
if not Flag:\r
GenFdsGlobalVariable.InfLogger(' Region Name = FV')\r
FileName = ImageBinDict[RegionData.upper() + 'fv']\r
# Generate FvImage.\r
#\r
FvObj = None\r
- if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(RegionData.upper())\r
+ if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict:\r
+ FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[RegionData.upper()]\r
\r
if FvObj is not None :\r
if not Flag:\r
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)\r
\r
FileName = RegionData\r
- elif RegionData.upper() + 'cap' in ImageBinDict.keys():\r
+ elif RegionData.upper() + 'cap' in ImageBinDict:\r
GenFdsGlobalVariable.InfLogger(' Region Name = CAPSULE')\r
FileName = ImageBinDict[RegionData.upper() + 'cap']\r
else:\r
# Generate Capsule image and Put it into FD buffer\r
#\r
CapsuleObj = None\r
- if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():\r
+ if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict:\r
CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[RegionData.upper()]\r
\r
if CapsuleObj is not None :\r