#!/usr/bin/env python3 # Builds test_report/index.html from the screenshots and test_report/captions.txt # (one line per screenshot: NAME | caption), plus test_report/feature_check.txt. import html, os os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'test_report')) captions = {} if os.path.exists('captions.txt'): for line in open('captions.txt'): if '|' in line: name, text = line.split('|', 1) captions[name.strip()] = text.strip() names = sorted(f[:-4] for f in os.listdir('.') if f.endswith('.png')) order = [n for n in captions if n in names] + [n for n in names if n not in captions] out = ['ACPC 2026 image, test report', '', '

ACPC 2026 contest image: test report

'] if os.path.exists('intro.txt'): out.append('

%s

' % html.escape(open('intro.txt').read().strip())) if os.path.exists('technotes_check.txt'): out.append('

Technical notes checklist

%s
' % html.escape(open('technotes_check.txt').read())) if os.path.exists('feature_check.txt'): out.append('

Feature checklist

%s
' % html.escape(open('feature_check.txt').read())) out.append('

Screens

') for n in order: out.append('
%s %s
' % (html.escape(n), html.escape(captions.get(n, '')), n)) out.append('') open('index.html', 'w').write('\n'.join(out)) print('test_report/index.html:', len(order), 'screens')