## @file\r
# Target Tool Parser\r
#\r
-# Copyright (c) 2007 - 2014, 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
LineList = Line.split(KeySplitCharacter,1)\r
if len(LineList) >= 2:\r
Key = LineList[0].strip()\r
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():\r
+ if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:\r
if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \\r
or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \\r
or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:\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
LineList = Line.split(KeySplitCharacter,1)\r
if len(LineList) >= 2:\r
Key = LineList[0].strip()\r
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():\r
+ if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:\r
if Key not in existKeys:\r
existKeys.append(Key)\r
else:\r
if ret is not None:\r
Line = ret\r
fw.write(Line)\r
- for key in self.TargetTxtDictionary.keys():\r
+ for key in self.TargetTxtDictionary:\r
if key not in existKeys:\r
print "Warning: %s does not exist in original configuration file" % key\r
Line = GetConfigureKeyValue(self, key)\r
FileHandle.RWFile('#', '=', 0)\r
else:\r
FileHandle.RWFile('#', '=', 1)\r
- except Exception, e:\r
+ except Exception as e:\r
last_type, last_value, last_tb = sys.exc_info()\r
traceback.print_exception(last_type, last_value, last_tb)\r
\r