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