diff --git a/tools/daca2-report.py b/tools/daca2-report.py index 656e86413..472eed23e 100644 --- a/tools/daca2-report.py +++ b/tools/daca2-report.py @@ -2,7 +2,6 @@ import os import sys import subprocess - def readdate(data): datepos = -1 if data[:5] == 'DATE ': @@ -77,63 +76,58 @@ for lib in [False, True]: for a in "0123456789abcdefghijklmnopqrstuvwxyz": if lib == True: a = "lib" + a - if os.path.isfile(daca2 + a + '/results.txt'): - f = open(daca2 + a + '/results.txt', 'rt') - data = f.read() - f.close() + if not os.path.isfile(daca2 + a + '/results.txt'): + continue - datestr = readdate(data) + f = open(daca2 + a + '/results.txt', 'rt') + data = f.read() + f.close() - if os.path.isfile(daca2 + 'results-' + a + '.txt'): - f2 = open(daca2 + 'results-' + a + '.txt') - data2 = f2.read() - f2.close() + if data.find('ftp://')<0: + continue - datestr2 = readdate(data2) - if not datestr or datestr < datestr2: - data = data2 - datestr = datestr2 + datestr = readdate(data) - if datestr: - if not lastupdate or datestr > lastupdate: - lastupdate = datestr - recent = [] - if datestr == lastupdate: - recent.append(a) - else: - datestr = '' + if datestr: + if not lastupdate or datestr > lastupdate: + lastupdate = datestr + recent = [] + if datestr == lastupdate: + recent.append(a) + else: + datestr = '' - mainpage.write( - '' + - '' + a + '' + - '' + datestr + '' + - '' + str(data.count(': error:')) + '' + - '' + str(data.count(': warning:')) + '' + - '' + str(data.count(': performance:')) + '' + - '' + str(data.count(': portability:')) + '' + - '' + str(data.count(': style:')) + '' + - '' + str(data.count('Crash?')) + '' + - '' + str(data.count('with varid 0.')) + '' + - '\n') + mainpage.write( + '' + + '' + a + '' + + '' + datestr + '' + + '' + str(data.count(': error:')) + '' + + '' + str(data.count(': warning:')) + '' + + '' + str(data.count(': performance:')) + '' + + '' + str(data.count(': portability:')) + '' + + '' + str(data.count(': style:')) + '' + + '' + str(data.count('Crash?')) + '' + + '' + str(data.count('with varid 0.')) + '' + + '\n') - data = data.replace('&', '&') - data = data.replace('<', '<') - data = data.replace('>', '>') - data = data.replace('\n', '\n') + data = data.replace('&', '&') + data = data.replace('<', '<') + data = data.replace('>', '>') + data = data.replace('\n', '\n') - f = open(path + 'daca2-' + a + '.html', 'wt') - f.write('\n') - f.write('\n') - f.write('\n') - f.write('\n') - f.write('DACA2 - ' + a + '\n') - f.write('\n') - f.write('\n') - f.write('

DACA2 - ' + a + '

') - f.write('
\n' + data + '
\n') - f.write('\n') - f.write('\n') - f.close() + f = open(path + 'daca2-' + a + '.html', 'wt') + f.write('\n') + f.write('\n') + f.write('\n') + f.write('\n') + f.write('DACA2 - ' + a + '\n') + f.write('\n') + f.write('\n') + f.write('

DACA2 - ' + a + '

') + f.write('
\n' + data + '
\n') + f.write('\n') + f.write('\n') + f.close() mainpage.write('\n')