- From: Anne van Kesteren <web-platform-tests-notifications@w3.org>
- Date: Wed, 15 Mar 2017 09:49:43 GMT
- To: public-web-platform-tests-notifications@w3.org
This was done in an automated fashion: ```python import os, html5lib path = "./" for filename in os.listdir(path): filename_tuple = os.path.splitext(filename) if filename_tuple[1] == ".htm" or filename_tuple[1] == ".html": output = u"" with open(filename, "r") as f: root = html5lib.parse(f, "etree") for script in root.iter("{http://www.w3.org/1999/xhtml}script"): if u"src" in script.attrib: if script.attrib[u"src"] in (u"/resources/testharness.js", u"/resources/testharnessreport.js"): continue else: output += u"// META: script=" + script.attrib[u"src"] + u"\n" else: output += u"\n" + script.text.strip("\n") new_file_name = filename_tuple[0] + ".any.js" os.rename(os.path.join(path,filename),os.path.join(path,new_file_name)) with open(new_file_name, "w") as f: f.write(output.strip().encode("utf-8")) f.write(u"\n") ``` View on GitHub: https://github.com/w3c/web-platform-tests/pull/5148#issuecomment-286692280
Received on Wednesday, 15 March 2017 09:49:54 UTC