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:
@ -17,14 +17,14 @@
|
||||
import Common.EdkLogger as EdkLogger
|
||||
from Common.BuildToolError import *
|
||||
from Common.DataType import *
|
||||
|
||||
|
||||
|
||||
class InfSectionParser():
|
||||
def __init__(self, FilePath):
|
||||
self._FilePath = FilePath
|
||||
self._FileSectionDataList = []
|
||||
self._ParserInf()
|
||||
|
||||
|
||||
def _ParserInf(self):
|
||||
FileLinesList = []
|
||||
UserExtFind = False
|
||||
@ -32,12 +32,12 @@ class InfSectionParser():
|
||||
FileLastLine = False
|
||||
SectionLine = ''
|
||||
SectionData = []
|
||||
|
||||
|
||||
try:
|
||||
FileLinesList = open(self._FilePath, "r", 0).readlines()
|
||||
except BaseException:
|
||||
EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened failed.' % self._FilePath)
|
||||
|
||||
|
||||
for Index in range(0, len(FileLinesList)):
|
||||
line = str(FileLinesList[Index]).strip()
|
||||
if Index + 1 == len(FileLinesList):
|
||||
@ -52,7 +52,7 @@ class InfSectionParser():
|
||||
SectionLine = line
|
||||
UserExtFind = True
|
||||
FindEnd = False
|
||||
|
||||
|
||||
if (NextLine != '' and NextLine[0] == TAB_SECTION_START and \
|
||||
NextLine[-1] == TAB_SECTION_END) or FileLastLine:
|
||||
UserExtFind = False
|
||||
@ -60,7 +60,7 @@ class InfSectionParser():
|
||||
self._FileSectionDataList.append({SectionLine: SectionData[:]})
|
||||
del SectionData[:]
|
||||
SectionLine = ''
|
||||
|
||||
|
||||
# Get user extension TianoCore data
|
||||
#
|
||||
# @return: a list include some dictionary that key is section and value is a list contain all data.
|
||||
|
Reference in New Issue
Block a user