OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Provides read access to buildbot's global_variables.json . | 8 Provides read access to buildbot's global_variables.json . |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 import HTMLParser | |
13 import json | 12 import json |
14 import re | |
15 import retrieve_from_googlesource | 13 import retrieve_from_googlesource |
16 import svn | |
17 import sys | 14 import sys |
18 | 15 |
19 | 16 |
20 _global_vars = None | 17 _global_vars = None |
21 | 18 |
22 | 19 |
23 SKIABOT_REPO = 'https://skia.googlesource.com/buildbot' | 20 SKIABOT_REPO = 'https://skia.googlesource.com/buildbot' |
24 _GLOBAL_VARS_PATH = 'site_config/global_variables.json' | 21 _GLOBAL_VARS_PATH = 'site_config/global_variables.json' |
25 | 22 |
26 | 23 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 except ValueError as e: | 64 except ValueError as e: |
68 raise JsonDecodeError(e.message + '\n' + global_vars_text) | 65 raise JsonDecodeError(e.message + '\n' + global_vars_text) |
69 try: | 66 try: |
70 return _global_vars[var_name]['value'] | 67 return _global_vars[var_name]['value'] |
71 except KeyError: | 68 except KeyError: |
72 raise NoSuchGlobalVariable(var_name) | 69 raise NoSuchGlobalVariable(var_name) |
73 | 70 |
74 | 71 |
75 if __name__ == '__main__': | 72 if __name__ == '__main__': |
76 print Get(sys.argv[1]) | 73 print Get(sys.argv[1]) |
OLD | NEW |