#!/usr/bin/env python3 """Copy Kate's syntax definitions into assets/syntax and record each file's licence. python tools/vendor_syntax.py """ import html, os, re, shutil, sys src, version = sys.argv[1], sys.argv[2] dst = "assets/syntax" shutil.rmtree(dst, ignore_errors=True) os.makedirs(dst) rows = [] for f in sorted(os.listdir(src)): if not f.endswith(".xml"): continue shutil.copy(os.path.join(src, f), dst) head = open(os.path.join(src, f), "rb").read(8192).decode("utf8", "replace") tag = head[head.find("