Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: infra/bots/add_isolated_input.py

Issue 1827413002: Fixes for Swarming recipes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reinstate tmp_dir Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | infra/bots/common.py » ('j') | infra/bots/common.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2016 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8
9 import argparse
10 import json
11
12
13 """Add the given hash to the includes section of the given isolated file."""
14
15
16 def add_isolated_hash(isolated_file, hash_str):
17 with open(isolated_file) as f:
18 isolated = json.load(f)
19 isolated['includes'].append(hash_str)
20 with open(isolated_file, 'w') as f:
21 json.dump(isolated, f, sort_keys=True)
22
23
24 def main():
25 parser = argparse.ArgumentParser()
26 parser.add_argument('--isolated_file', required=True)
27 parser.add_argument('--hash', required=True)
28 args = parser.parse_args()
29 add_isolated_hash(args.isolated_file, args.hash)
30
31
32 if __name__ == '__main__':
33 main()
OLDNEW
« no previous file with comments | « no previous file | infra/bots/common.py » ('j') | infra/bots/common.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698