else:\r
Workspace = os.path.normcase(Options.Workspace)\r
GenFdsGlobalVariable.WorkSpaceDir = Workspace\r
- if 'EDK_SOURCE' in os.environ.keys():\r
+ if 'EDK_SOURCE' in os.environ:\r
GenFdsGlobalVariable.EdkSourceDir = os.path.normcase(os.environ['EDK_SOURCE'])\r
if (Options.debug):\r
GenFdsGlobalVariable.VerboseLogger("Using Workspace:" + Workspace)\r
# This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf\r
ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)\r
else:\r
- if "CONF_PATH" in os.environ.keys():\r
+ if "CONF_PATH" in os.environ:\r
ConfDirectoryPath = os.path.normcase(os.environ["CONF_PATH"])\r
else:\r
# Get standard WORKSPACE/Conf, use the absolute path to the WORKSPACE/Conf\r
os.environ["WORKSPACE"] = Workspace\r
\r
# Use the -t and -b option as gGlobalDefines's TOOLCHAIN and TARGET if they are not defined\r
- if "TARGET" not in GlobalData.gGlobalDefines.keys():\r
+ if "TARGET" not in GlobalData.gGlobalDefines:\r
GlobalData.gGlobalDefines["TARGET"] = GenFdsGlobalVariable.TargetName\r
- if "TOOLCHAIN" not in GlobalData.gGlobalDefines.keys():\r
+ if "TOOLCHAIN" not in GlobalData.gGlobalDefines:\r
GlobalData.gGlobalDefines["TOOLCHAIN"] = GenFdsGlobalVariable.ToolChainTag\r
- if "TOOL_CHAIN_TAG" not in GlobalData.gGlobalDefines.keys():\r
+ if "TOOL_CHAIN_TAG" not in GlobalData.gGlobalDefines:\r
GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = GenFdsGlobalVariable.ToolChainTag\r
\r
"""call Workspace build create database"""\r
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Cycle Reference Detected in FDF file")\r
\r
if (Options.uiFdName) :\r
- if Options.uiFdName.upper() in FdfParserObj.Profile.FdDict.keys():\r
+ if Options.uiFdName.upper() in FdfParserObj.Profile.FdDict:\r
GenFds.OnlyGenerateThisFd = Options.uiFdName\r
else:\r
EdkLogger.error("GenFds", OPTION_VALUE_INVALID,\r
"No such an FD in FDF file: %s" % Options.uiFdName)\r
\r
if (Options.uiFvName) :\r
- if Options.uiFvName.upper() in FdfParserObj.Profile.FvDict.keys():\r
+ if Options.uiFvName.upper() in FdfParserObj.Profile.FvDict:\r
GenFds.OnlyGenerateThisFv = Options.uiFvName\r
else:\r
EdkLogger.error("GenFds", OPTION_VALUE_INVALID,\r
"No such an FV in FDF file: %s" % Options.uiFvName)\r
\r
if (Options.uiCapName) :\r
- if Options.uiCapName.upper() in FdfParserObj.Profile.CapsuleDict.keys():\r
+ if Options.uiCapName.upper() in FdfParserObj.Profile.CapsuleDict:\r
GenFds.OnlyGenerateThisCap = Options.uiCapName\r
else:\r
EdkLogger.error("GenFds", OPTION_VALUE_INVALID,\r
KeyStringList.append(Target + '_' + ToolChain + '_' + Arch)\r
\r
if GenFdsGlobalVariable.GuidToolDefinition:\r
- if NameGuid in GenFdsGlobalVariable.GuidToolDefinition.keys():\r
+ if NameGuid in GenFdsGlobalVariable.GuidToolDefinition:\r
return GenFdsGlobalVariable.GuidToolDefinition[NameGuid]\r
\r
ToolDefinition = ToolDefClassObject.ToolDefDict(GenFdsGlobalVariable.ConfDir).ToolsDefTxtDictionary\r
if Key in KeyStringList and KeyList[4] == 'GUID':\r
ToolPathKey = Key + '_' + KeyList[3] + '_PATH'\r
ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS'\r
- if ToolPathKey in BuildOption.keys():\r
- ToolPathTmp = BuildOption.get(ToolPathKey)\r
- if ToolOptionKey in BuildOption.keys():\r
- ToolOption = BuildOption.get(ToolOptionKey)\r
+ if ToolPathKey in BuildOption:\r
+ ToolPathTmp = BuildOption[ToolPathKey]\r
+ if ToolOptionKey in BuildOption:\r
+ ToolOption = BuildOption[ToolOptionKey]\r
\r
GenFdsGlobalVariable.GuidToolDefinition[NameGuid] = (ToolPathTmp, ToolOption)\r
return ToolPathTmp, ToolOption\r
GenFdsGlobalVariable.SetDir ('', FdfParser, WorkSpace, ArchList)\r
\r
GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and their required FV and Capsule images!")\r
- if GenFds.OnlyGenerateThisCap is not None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():\r
- CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.get(GenFds.OnlyGenerateThisCap.upper())\r
+ if GenFds.OnlyGenerateThisCap is not None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict:\r
+ CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[GenFds.OnlyGenerateThisCap.upper()]\r
if CapsuleObj is not None:\r
CapsuleObj.GenCapsule()\r
return\r
\r
- if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(GenFds.OnlyGenerateThisFd.upper())\r
+ if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict:\r
+ FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds.OnlyGenerateThisFd.upper()]\r
if FdObj is not None:\r
FdObj.GenFd()\r
return\r
elif GenFds.OnlyGenerateThisFd is None and GenFds.OnlyGenerateThisFv is None:\r
- for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]\r
+ for FdObj in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():\r
FdObj.GenFd()\r
\r
GenFdsGlobalVariable.VerboseLogger("\n Generate other FV images! ")\r
- if GenFds.OnlyGenerateThisFv is not None and GenFds.OnlyGenerateThisFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(GenFds.OnlyGenerateThisFv.upper())\r
+ if GenFds.OnlyGenerateThisFv is not None and GenFds.OnlyGenerateThisFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict:\r
+ FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[GenFds.OnlyGenerateThisFv.upper()]\r
if FvObj is not None:\r
Buffer = StringIO.StringIO()\r
FvObj.AddToBuffer(Buffer)\r
Buffer.close()\r
return\r
elif GenFds.OnlyGenerateThisFv is None:\r
- for FvName in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
+ for FvObj in GenFdsGlobalVariable.FdfParser.Profile.FvDict.values():\r
Buffer = StringIO.StringIO('')\r
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[FvName]\r
FvObj.AddToBuffer(Buffer)\r
Buffer.close()\r
\r
if GenFds.OnlyGenerateThisFv is None and GenFds.OnlyGenerateThisFd is None and GenFds.OnlyGenerateThisCap is None:\r
if GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict != {}:\r
GenFdsGlobalVariable.VerboseLogger("\n Generate other Capsule images!")\r
- for CapsuleName in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():\r
- CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[CapsuleName]\r
+ for CapsuleObj in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.values():\r
CapsuleObj.GenCapsule()\r
\r
if GenFdsGlobalVariable.FdfParser.Profile.OptRomDict != {}:\r
GenFdsGlobalVariable.VerboseLogger("\n Generate all Option ROM!")\r
- for DriverName in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.keys():\r
- OptRomObj = GenFdsGlobalVariable.FdfParser.Profile.OptRomDict[DriverName]\r
+ for OptRomObj in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.values():\r
OptRomObj.AddToBuffer(None)\r
@staticmethod\r
def GenFfsMakefile(OutputDir, FdfParser, WorkSpace, ArchList, GlobalData):\r
GenFdsGlobalVariable.SetEnv(FdfParser, WorkSpace, ArchList, GlobalData)\r
- for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]\r
+ for FdObj in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():\r
FdObj.GenFd(Flag=True)\r
\r
- for FvName in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[FvName]\r
+ for FvObj in GenFdsGlobalVariable.FdfParser.Profile.FvDict.values():\r
FvObj.AddToBuffer(Buffer=None, Flag=True)\r
\r
if GenFdsGlobalVariable.FdfParser.Profile.OptRomDict != {}:\r
- for DriverName in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.keys():\r
- OptRomObj = GenFdsGlobalVariable.FdfParser.Profile.OptRomDict[DriverName]\r
+ for OptRomObj in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.values():\r
OptRomObj.AddToBuffer(Buffer=None, Flag=True)\r
\r
return GenFdsGlobalVariable.FfsCmdDict\r
def GetFvBlockSize(FvObj):\r
DefaultBlockSize = 0x1\r
FdObj = None\r
- if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
+ if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict:\r
FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds.OnlyGenerateThisFd.upper()]\r
if FdObj is None:\r
for ElementFd in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():\r