diff options
author | Liming Gao <liming.gao@intel.com> | 2018-07-05 17:40:04 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-07-09 10:25:47 +0800 |
commit | f7496d717357b9af78414d19679b073403812340 (patch) | |
tree | 67621e65fd181bdf8a12d12e7706579beaaed0fb /BaseTools/Source/Python/Ecc/Exception.py | |
parent | 39456d00f36e04b7e7efb208f350f4e83b6c3531 (diff) | |
download | edk2-f7496d717357b9af78414d19679b073403812340.tar.gz edk2-f7496d717357b9af78414d19679b073403812340.tar.bz2 edk2-f7496d717357b9af78414d19679b073403812340.zip |
BaseTools: Clean up source files
1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Ecc/Exception.py')
-rw-r--r-- | BaseTools/Source/Python/Ecc/Exception.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/Ecc/Exception.py b/BaseTools/Source/Python/Ecc/Exception.py index bde41c3a4b..0498a503d7 100644 --- a/BaseTools/Source/Python/Ecc/Exception.py +++ b/BaseTools/Source/Python/Ecc/Exception.py @@ -1,7 +1,7 @@ ## @file
# This file is used to parse exception items found by ECC tool
#
-# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -24,12 +24,12 @@ class ExceptionXml(object): self.KeyWord = ''
self.ErrorID = ''
self.FilePath = ''
-
+
def FromXml(self, Item, Key):
self.KeyWord = XmlElement(Item, '%s/KeyWord' % Key)
self.ErrorID = XmlElement(Item, '%s/ErrorID' % Key)
self.FilePath = os.path.normpath(XmlElement(Item, '%s/FilePath' % Key))
-
+
def __str__(self):
return 'ErrorID = %s KeyWord = %s FilePath = %s' %(self.ErrorID, self.KeyWord, self.FilePath)
@@ -37,22 +37,22 @@ class ExceptionXml(object): class ExceptionListXml(object):
def __init__(self):
self.List = []
-
+
def FromXmlFile(self, FilePath):
XmlContent = XmlParseFile(FilePath)
for Item in XmlList(XmlContent, '/ExceptionList/Exception'):
Exp = ExceptionXml()
Exp.FromXml(Item, 'Exception')
self.List.append(Exp)
-
+
def ToList(self):
RtnList = []
for Item in self.List:
#RtnList.append((Item.ErrorID, Item.KeyWord, Item.FilePath))
RtnList.append((Item.ErrorID, Item.KeyWord))
-
+
return RtnList
-
+
def __str__(self):
RtnStr = ''
if self.List:
@@ -71,7 +71,7 @@ class ExceptionCheck(object): if FilePath and os.path.isfile(FilePath):
self.ExceptionListXml.FromXmlFile(FilePath)
self.ExceptionList = self.ExceptionListXml.ToList()
-
+
def IsException(self, ErrorID, KeyWord, FileID=-1):
if (str(ErrorID), KeyWord.replace('\r\n', '\n')) in self.ExceptionList:
return True
|