summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/InfSectionParser.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-07-05 17:40:04 +0800
committerLiming Gao <liming.gao@intel.com>2018-07-09 10:25:47 +0800
commitf7496d717357b9af78414d19679b073403812340 (patch)
tree67621e65fd181bdf8a12d12e7706579beaaed0fb /BaseTools/Source/Python/AutoGen/InfSectionParser.py
parent39456d00f36e04b7e7efb208f350f4e83b6c3531 (diff)
downloadedk2-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/AutoGen/InfSectionParser.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/InfSectionParser.py12
1 files changed, 6 insertions, 6 deletions
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.