BaseTools: Enhance the report to not show the empty section

Enhance the report to not show the empty section, eg: Module Library
Sub-section, if there is nothing in this section, we will not show it
in the report.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu 2017-06-08 10:14:02 +08:00
parent 778aad47e8
commit c2d0a1f6d2
1 changed files with 5 additions and 8 deletions

View File

@ -318,9 +318,9 @@ class LibraryReport(object):
# @param File The file object for report # @param File The file object for report
# #
def GenerateReport(self, File): def GenerateReport(self, File):
FileWrite(File, gSubSectionStart)
FileWrite(File, TAB_BRG_LIBRARY)
if len(self.LibraryList) > 0: if len(self.LibraryList) > 0:
FileWrite(File, gSubSectionStart)
FileWrite(File, TAB_BRG_LIBRARY)
FileWrite(File, gSubSectionSep) FileWrite(File, gSubSectionSep)
for LibraryItem in self.LibraryList: for LibraryItem in self.LibraryList:
LibInfPath = LibraryItem[0] LibInfPath = LibraryItem[0]
@ -347,7 +347,7 @@ class LibraryReport(object):
else: else:
FileWrite(File, "{%s}" % LibClass) FileWrite(File, "{%s}" % LibClass)
FileWrite(File, gSubSectionEnd) FileWrite(File, gSubSectionEnd)
## ##
# Reports dependency expression information # Reports dependency expression information
@ -411,9 +411,6 @@ class DepexReport(object):
# #
def GenerateReport(self, File, GlobalDepexParser): def GenerateReport(self, File, GlobalDepexParser):
if not self.Depex: if not self.Depex:
FileWrite(File, gSubSectionStart)
FileWrite(File, TAB_DEPEX)
FileWrite(File, gSubSectionEnd)
return return
FileWrite(File, gSubSectionStart) FileWrite(File, gSubSectionStart)
if os.path.isfile(self._DepexFileName): if os.path.isfile(self._DepexFileName):
@ -866,7 +863,7 @@ class PcdReport(object):
FileWrite(File, " *M - Module scoped PCD override") FileWrite(File, " *M - Module scoped PCD override")
FileWrite(File, gSectionSep) FileWrite(File, gSectionSep)
else: else:
if not ReportSubType: if not ReportSubType and ModulePcdSet:
# #
# For module PCD sub-section # For module PCD sub-section
# #
@ -1011,7 +1008,7 @@ class PcdReport(object):
if ModulePcdSet == None: if ModulePcdSet == None:
FileWrite(File, gSectionEnd) FileWrite(File, gSectionEnd)
else: else:
if not ReportSubType: if not ReportSubType and ModulePcdSet:
FileWrite(File, gSubSectionEnd) FileWrite(File, gSubSectionEnd)