7 def __init__(self, filePath):
8 self._file = open(filePath, 'r')
12 self._lines = self._file.readlines()
13 self._lines[:] = [line for line in self._lines if ": warning" in line]
14 self.warnings = [[0 for i in range(4)] for y in range(len(self._lines))]
16 for index, line in enumerate(self._lines):
17 self._lines[index] = line.split(":")
18 self._lines[index][0] = self._lines[index][0][:-1].split("(")
20 self.warnings[index][self.FILE] = self._lines[index][0][0]
21 self.warnings[index][self.LINE_NUMBER] = int(self._lines[index][0][1].split(",")[0])
22 self.warnings[index][self.WARNING_CODE] = self._lines[index][1]
23 self.warnings[index][self.MESSAGE] = self._lines[index][2].split("[/")[0]
28 if __name__ == "__main__":
29 logPath = "../../build.log"
30 logs = BuildLog(logPath)