diff -r ac0bbc1e5d79 -r 8dd670a9f34f sbsv2/raptor/bin/sbs_index.py --- a/sbsv2/raptor/bin/sbs_index.py Mon Sep 13 13:11:19 2010 +0800 +++ b/sbsv2/raptor/bin/sbs_index.py Mon Sep 13 14:04:04 2010 +0100 @@ -6,20 +6,16 @@ # under the terms of the License "Symbian Foundation License v1.0" # which accompanies this distribution, and is available # at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# Tie together a set of HTML build summaries by creating a single index page -# which shows the total number of Errors, Warnings etc. across all the parts -# of the build and links to the individual summaries. + +''' +Tie together a set of HTML build summaries by creating a single index page +which shows the total number of Errors, Warnings etc. across all the parts +of the build and links to the individual summaries. +''' import os import sys +import time # get the absolute path to this script script = os.path.abspath(sys.argv[0]) @@ -104,8 +100,13 @@ for row in reader: type = int(row[0]) style = row[1] - count = int(row[2]) - if count == 0 or filter_html.Records.SUBDIRS[type] == style: + + if style == 'time': + count = float(row[2]) + else: + count = int(row[2]) + + if count == 0 or filter_html.Records.CLASSES[type] == style: grandtotal[type] += count columns.append((style,count)) else: @@ -119,7 +120,11 @@ linkname = os.path.relpath(os.path.join(linktext, "index.html"), indexdir) index.write('%s' % (linkname, linktext)) for (style, count) in columns: - index.write('%d' % (style, count)) + if style == 'time': + n = time.strftime("%H:%M:%S", time.gmtime(count + 0.5)) + else: + n = str(count) + index.write('%s' % (style, n)) index.write("") except: sys.stderr.write("error: cannot write index file %s\n" % indexfile) @@ -129,10 +134,16 @@ try: index.write(' total') for i, count in enumerate(grandtotal): + style = filter_html.Records.CLASSES[i] + if style == 'time': + n = time.strftime("%H:%M:%S", time.gmtime(count + 0.5)) + else: + n = str(count) + if count == 0: index.write('0') else: - index.write('%d' % (filter_html.Records.SUBDIRS[i], count)) + index.write('%s' % (style, n)) index.write("") index.write("\n") index.close()