import os, re, json, sys D='/home/claude/afterlight/storyboard' tpl=open(f'{D}/board.template.html').read() parts=[] for n in range(1,9): p=f'{D}/film{n}.js' if os.path.exists(p): js=open(p).read().replace('/* film{n}.js */\n{js}\n') report=open(f'{D}/report.html').read() if os.path.exists(f'{D}/report.html') else '' parts.append('') out=tpl.replace('','\n'.join(parts)) open(f'{D}/afterlight-keyframes.html','w').write(out) print('films',sum(os.path.exists(f'{D}/film{n}.js') for n in range(1,9)),'bytes',len(out))