#!/usr/bin/env python3 # @(#) update create.html from JSON files # (categories and languages only; the PMC list is now built in the browser # by site/js/doap_editor.js from json/foundation/committees.json) import os import json import re # This currently reads data at load time import committee_info SITEDIR = os.path.join(committee_info.COMDEV_HOME, 'site') validation = {} with open(os.path.join(SITEDIR, "validation.json"), encoding='utf-8') as f: validation = json.loads(f.read()) lang = validation['languages'] cats = validation['categories'] createfile = os.path.join(SITEDIR, "create.html") createfilet = os.path.join(SITEDIR, "create.html.t") sections = 0 with open(createfile,'r', encoding='utf-8') as r, open(createfilet,'w', encoding='utf-8') as w: section = None line = 0 for l in r: # start of a section? m = re.match(r'^\s+