#!/usr/bin/env python3 import os import re re_testname = re.compile(r"^appearance-.+\d\d\d\.html$") re_link_match = re.compile(r' """ for filename, text in files.items(): if re_link_match.search(text): with open(os.path.join(parentdir, filename.replace("appearance-", "webkit-appearance-")), "w") as outfile: outfile.write(warning + text.replace("appearance:", "-webkit-appearance:"))