| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Access the commit queue from the command line. | 6 """Access the commit queue from the command line. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 __version__ = '0.1' | 9 __version__ = '0.1' |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 { | 160 { |
| 161 'master_name': [ | 161 'master_name': [ |
| 162 'builder_name', | 162 'builder_name', |
| 163 'another_builder' | 163 'another_builder' |
| 164 ], | 164 ], |
| 165 'another_master': [ | 165 'another_master': [ |
| 166 'third_builder' | 166 'third_builder' |
| 167 ] | 167 ] |
| 168 } | 168 } |
| 169 """ | 169 """ |
| 170 _, args = parser.parse_args(args) | 170 parser.add_option('--include-experimental', action='store_true') |
| 171 parser.add_option('--exclude-experimental', action='store_false', |
| 172 dest='include_experimental') |
| 173 parser.add_option('--include-triggered', action='store_true') |
| 174 parser.add_option('--exclude-triggered', action='store_false', |
| 175 dest='include_triggered') |
| 176 # The defaults have been chosen because of backward compatbility. |
| 177 parser.set_defaults(include_experimental=True, include_triggered=True) |
| 178 options, args = parser.parse_args(args) |
| 171 if len(args) != 1: | 179 if len(args) != 1: |
| 172 parser.error('Expected a single path to CQ config. Got: %s' % | 180 parser.error('Expected a single path to CQ config. Got: %s' % |
| 173 ' '.join(args)) | 181 ' '.join(args)) |
| 174 print json.dumps(get_master_builder_map(args[0])) | 182 print json.dumps(get_master_builder_map( |
| 183 args[0], |
| 184 include_experimental=options.include_experimental, |
| 185 include_triggered=options.include_triggered)) |
| 175 | 186 |
| 176 CMDbuilders.func_usage_more = '<path-to-cq-config>' | 187 CMDbuilders.func_usage_more = '<path-to-cq-config>' |
| 177 | 188 |
| 178 | 189 |
| 179 def CMDvalidate(parser, args): | 190 def CMDvalidate(parser, args): |
| 180 """Validates a CQ config. | 191 """Validates a CQ config. |
| 181 | 192 |
| 182 Takes a single argument - path to the CQ config to be validated. Returns 0 on | 193 Takes a single argument - path to the CQ config to be validated. Returns 0 on |
| 183 valid config, non-zero on invalid config. Errors and warnings are printed to | 194 valid config, non-zero on invalid config. Errors and warnings are printed to |
| 184 screen. | 195 screen. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 return CMDhelp(parser, args) | 285 return CMDhelp(parser, args) |
| 275 | 286 |
| 276 | 287 |
| 277 if __name__ == "__main__": | 288 if __name__ == "__main__": |
| 278 fix_encoding.fix_encoding() | 289 fix_encoding.fix_encoding() |
| 279 try: | 290 try: |
| 280 sys.exit(main()) | 291 sys.exit(main()) |
| 281 except KeyboardInterrupt: | 292 except KeyboardInterrupt: |
| 282 sys.stderr.write('interrupted\n') | 293 sys.stderr.write('interrupted\n') |
| 283 sys.exit(1) | 294 sys.exit(1) |
| OLD | NEW |