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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user