gecko-dev/testing/web-platform/tests/tools/runner/update_manifest.py
moz-wptsync-bot d5afba679b Bug 1467956 [wpt PR 11439] - Fix F401 (unused import) throughout tools/, a=testonly
Automatic update from web-platform-testsFix F401 (unused import) throughout tools/ (#11439)

--

wpt-commits: a65ac1967489f9519e4e58190c45df529da3f2b5
wpt-pr: 11439
2018-07-11 07:49:20 +01:00

27 lines
711 B
Python

import imp
import json
import os
here = os.path.dirname(__file__)
localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py")))
root = localpaths.repo_root
from manifest import manifest, update
def main(request, response):
path = os.path.join(root, "MANIFEST.json")
manifest_file = None
try:
manifest_file = manifest.load(root, path)
except manifest.ManifestVersionMismatch:
pass
if manifest_file is None:
manifest_file = manifest.Manifest("/")
update.update(root, manifest_file)
manifest.write(manifest_file, path)
return [("Content-Type", "application/json")], json.dumps({"url": "/MANIFEST.json"})