diff options
author | JF Bastien <jfb@chromium.org> | 2016-01-13 13:59:28 -0800 |
---|---|---|
committer | JF Bastien <jfb@chromium.org> | 2016-01-13 13:59:28 -0800 |
commit | 9a3a2cb975ab171c4f23c5bf5e938db940c707d4 (patch) | |
tree | 6450dcaae1a7ef879aea8ad9e1cd2aba2e66c42d | |
parent | 80d0b8eb31b1bb15ecd2245ef6ad57ca4d3a2575 (diff) | |
download | binaryen-9a3a2cb975ab171c4f23c5bf5e938db940c707d4.tar.gz binaryen-9a3a2cb975ab171c4f23c5bf5e938db940c707d4.tar.bz2 binaryen-9a3a2cb975ab171c4f23c5bf5e938db940c707d4.zip |
update.py: support json output
I'm updating the waterfall separately.
-rwxr-xr-x | update.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -16,6 +16,7 @@ import filecmp import glob +import json import os import shutil import subprocess @@ -33,7 +34,15 @@ TORTURE_DIR = os.path.join(BASE_DIR, 'torture-s') def download_revision(force_latest): name = 'latest' if force_latest else 'lkgr' - return urllib2.urlopen(STORAGE_BASE + name).read().strip() + downloaded = urllib2.urlopen(STORAGE_BASE + name).read().strip() + # TODO: for now try opening as JSON, if that doesn't work then the content is + # just a hash. The waterfall is in the process of migrating to JSON. + info = None + try: + info = json.loads(downloaded) + except: + pass + return info['build'] if type(info) == dict else downloaded def write_revision(revision): |