Skip to content

Instantly share code, notes, and snippets.

@Ms2ger
Created February 1, 2018 15:25
Show Gist options
  • Save Ms2ger/c862103e17e994de41335f9f89e3d88c to your computer and use it in GitHub Desktop.
Save Ms2ger/c862103e17e994de41335f9f89e3d88c to your computer and use it in GitHub Desktop.
update-from-bot.py
import re
import subprocess
import sys
# https://build.webkit.org/results/WPE%20Linux%2064-bit%20Release%20(Tests)/r227958%20(5851)/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-actual.txt
url = sys.argv[1]
print("Loading from %s" % url)
if len(sys.argv) > 2:
platform_path = "platform/" + sys.argv[2] + "/"
else:
platform_path = ""
segments = url.split("/")
for i, segment in enumerate(segments):
if re.match(r"r[0-9]+%20\([0-9]+\)", segment):
index = i
segments[-1] = segments[-1].replace("-actual", "-expected")
path = "LayoutTests/" + platform_path + "/".join(segments[index+1:])
command = [
"wget",
"-O",
path,
url,
]
print(" ".join(command))
subprocess.call(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment