#!/usr/bin/env python3 """Rebuild the data payload inside 274-transect.html from 274-lookup.md. The HTML is self-contained: it carries its data in a )', lambda m: m.group(1) + payload + m.group(2), html, count=1, flags=re.S) if not n: sys.exit('data block not found in 274-transect.html') io.open(p('274-transect.html'), 'w', encoding='utf-8').write(new) print('%d entries, %d district bands, %d route points -> 274-transect.html' % (len(items), len(bands), len(route))) if __name__ == '__main__': main()