diff --git a/postprocess.py b/postprocess.py index 98b2a5f..3e0642a 100755 --- a/postprocess.py +++ b/postprocess.py @@ -23,6 +23,28 @@ ''' +report_temp = ''' + + + Will it scale report + + + + + + + + + + +{linkers} + +
namedescription
+ + +''' +case_data = [] + def parse_data(csvfile): data = [] fp = open(csvfile) @@ -47,12 +69,26 @@ def process(base): open(htmlfile, 'w').write(html) print('Created %s' % (htmlfile)) + case_data.append((base, title, htmlfile)) def for_each_file(dirname, subdirs, filenames): for f in filenames: if f.endswith('.csv'): process(f) +def generate_report_index(case_data, outfile='report.html'): + case_data.sort(key=lambda x: x[0]) + hyperlinks = "".join([ + f" \n" + f" {name}\n" + f" {title}\n" + f" \n" + for name, title, htmlfile in case_data + ]) + html = report_temp.format(linkers=hyperlinks) + with open(outfile, 'w', encoding='utf-8') as f: + f.write(html) + print(f"Created {outfile}") if __name__ == '__main__': @@ -65,3 +101,6 @@ def for_each_file(dirname, subdirs, filenames): process(tmp[0]) except: sys.exit(1) + + # Generate the report html + generate_report_index(case_data)