X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FInfSectionParser.py;h=d98508973841ed61ec9562151dd3cc3d2d5983d7;hp=2cd5a6667a0259e60a787df6bf29d32779735489;hb=f7496d717357b9af78414d19679b073403812340;hpb=39456d00f36e04b7e7efb208f350f4e83b6c3531 diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTools/Source/Python/AutoGen/InfSectionParser.py index 2cd5a6667a..d985089738 100644 --- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py +++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py @@ -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.