From 4afd5fcaf2a2881dc58ff9fa19f070e16fc7f811 Mon Sep 17 00:00:00 2001 From: "pshenoy@chromium.org" Date: Fri, 13 Jul 2012 01:41:27 +0000 Subject: Empty tag is written if there are no dirctories or no files. This was causing the following table after the empty table not to have sorting functionality. Fixed by including writing
tag inside 'if' statement. Review URL: https://chromiumcodereview.appspot.com/10736054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146504 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/code_coverage/croc_html.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/code_coverage') diff --git a/tools/code_coverage/croc_html.py b/tools/code_coverage/croc_html.py index 248529c..7866f47 100644 --- a/tools/code_coverage/croc_html.py +++ b/tools/code_coverage/croc_html.py @@ -378,20 +378,20 @@ class CrocHtml(object): for group in sorted(cov_dir.stats_by_group): self.AddItem(table, group, cov_dir.stats_by_group[group], None) - table = body.E('table', e_class='sortable') - table.E('h3').Text('Subdirectories') # List subdirs if cov_dir.subdirs: + table = body.E('table', e_class='sortable') + table.E('h3').Text('Subdirectories') self.AddSectionHeader(table, None, 'Subdirectory') for d in sorted(cov_dir.subdirs): self.AddItem(table, d + '/', cov_dir.subdirs[d].stats_by_group['all'], None, link=d + '/index.html') - table = body.E('table', e_class='sortable') - table.E('h3').Text('Files in This Directory') # List files if cov_dir.files: + table = body.E('table', e_class='sortable') + table.E('h3').Text('Files in This Directory') self.AddSectionHeader(table, None, 'Filename', is_file=True) -- cgit v1.1