this is no longer required to make dictionary objects iterable.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
if len(guidLineList) == 2:\r
guid = guidLineList[0]\r
guidName = guidLineList[1]\r
- if guid not in dictGuid.keys() :\r
+ if guid not in dictGuid :\r
dictGuid[guid] = guidName\r
\r
def createSym(symbolName):\r
for smiEntry in SmiEntry:\r
if smiEntry.hasAttribute("HandlerType"):\r
guidValue = smiEntry.getAttribute("HandlerType")\r
- if guidValue in dictGuid.keys() :\r
+ if guidValue in dictGuid:\r
smiEntry.setAttribute("HandlerType", dictGuid[guidValue])\r
SmiHandler = smiEntry.getElementsByTagName("SmiHandler")\r
for smiHandler in SmiHandler:\r
ImageEntryPoint = "_ModuleEntryPoint"\r
\r
for k, v in self._AutoGenObject.Module.Defines.iteritems():\r
- if k not in self._AutoGenObject.Macros.keys():\r
+ if k not in self._AutoGenObject.Macros:\r
self._AutoGenObject.Macros[k] = v\r
\r
if 'MODULE_ENTRY_POINT' not in self._AutoGenObject.Macros.keys():\r
' %s' %ErasePloarity + \\r
T_CHAR_LF)\r
if not (self.FvAttributeDict is None):\r
- for FvAttribute in self.FvAttributeDict.keys() :\r
+ for FvAttribute in self.FvAttributeDict:\r
if FvAttribute == "FvUsedSizeEnable":\r
if self.FvAttributeDict[FvAttribute].upper() in ('TRUE', '1') :\r
self.UsedSizeEnable = True\r
# @retval tuple (File list, boolean)\r
#\r
def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False):\r
- if FileType in Section.SectFileType.keys() :\r
- IsSect = True\r
- else :\r
- IsSect = False\r
+ IsSect = FileType in Section.SectFileType\r
\r
if FileExtension is not None:\r
Suffix = FileExtension\r
traceback.print_exception(last_type, last_value, last_tb)\r
\r
def Print(self):\r
- KeyList = self.TargetTxtDictionary.keys()\r
errMsg = ''\r
- for Key in KeyList:\r
+ for Key in self.TargetTxtDictionary:\r
if type(self.TargetTxtDictionary[Key]) == type([]):\r
print "%-30s = %s" % (Key, ''.join(elem + ' ' for elem in self.TargetTxtDictionary[Key]))\r
elif self.TargetTxtDictionary[Key] is None:\r
#\r
# Get all LibraryClasses\r
#\r
- LibClassObj = self.Parser.InfLibraryClassSection.LibraryClasses\r
- Keys = LibClassObj.keys()\r
- for Key in Keys:\r
- LibraryClassData = LibClassObj[Key]\r
+ for LibraryClassData in self.Parser.InfLibraryClassSection.LibraryClasses.values():\r
for Item in LibraryClassData:\r
LibraryClass = CommonObject.LibraryClassObject()\r
LibraryClass.SetUsage(DT.USAGE_ITEM_CONSUMES)\r
def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False):\r
if ModeIsSmm:\r
AddrIsOffset = False\r
- InfFileNameList = ModuleList.keys()\r
- #InfFileNameList.sort()\r
- for InfFile in InfFileNameList:\r
+ for InfFile in ModuleList:\r
sys.stdout.write (".")\r
sys.stdout.flush()\r
ModuleInfo = ModuleList[InfFile]\r