]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/Scripts/Ds5/build_report.py
ARM Packages: Fixed line endings
[mirror_edk2.git] / ArmPlatformPkg / Scripts / Ds5 / build_report.py
CommitLineData
1e57a462 1#\r
2# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
3# \r
4# This program and the accompanying materials \r
5# are licensed and made available under the terms and conditions of the BSD License \r
6# which accompanies this distribution. The full text of the license may be found at \r
7# http://opensource.org/licenses/bsd-license.php \r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11#\r
12\r
13import re\r
14\r
15class BuildReport:\r
16 PCDs = {}\r
17 \r
18 def parse_platform_summary(self, file):\r
19 pass\r
20 \r
21 def parse_pcd_report(self, report_file):\r
22 pcd_reg = re.compile(" (\*P|\*F|\*M| ) (\w+)(\ +)\: (.*) \((\w+)\) = (.*)\n")\r
23 \r
24 for line in report_file.xreadlines():\r
25 stripped_line = line.strip()\r
26 if re.match("\<=+\>", stripped_line):\r
27 return\r
28 elif re.match("g.*Guid", stripped_line):\r
29 guid = stripped_line\r
30 self.PCDs[guid] = {}\r
31 else:\r
32 m = pcd_reg.match(line)\r
33 if m:\r
34 self.PCDs[guid][m.group(2)] = (m.group(6).strip(),m.group(5))\r
35 \r
36 def parse_firmware_device(self, file):\r
37 pass\r
38 \r
39 def parse_module_summary(self, file):\r
40 #print "Module Summary"\r
41 pass\r
42 \r
43 CONST_SECTION_HEADERS = [('Platform Summary', parse_platform_summary),\r
44 ('Platform Configuration Database Report',parse_pcd_report),\r
45 ('Firmware Device (FD)',parse_firmware_device),\r
46 ('Module Summary',parse_module_summary)]\r
47 \r
48 def __init__(self, filename = 'report.log'):\r
49 report_file = open(filename, 'r')\r
50 for line in report_file.xreadlines():\r
51 for section_header in BuildReport.CONST_SECTION_HEADERS:\r
52 if line.strip() == section_header[0]:\r
53 section_header[1](self, report_file)\r
54 #print self.PCDs\r