| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 """ A collator for Service Manifests """ | 6 """ A collator for Service Manifests """ |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| 11 import shutil | 11 import shutil |
| 12 import sys | 12 import sys |
| 13 import urlparse | 13 import urlparse |
| 14 | 14 |
| 15 | 15 |
| 16 # Keys which are completely overridden by manifest overlays | 16 # Keys which are completely overridden by manifest overlays |
| 17 _MANIFEST_OVERLAY_OVERRIDE_KEYS = [ | 17 _MANIFEST_OVERLAY_OVERRIDE_KEYS = [ |
| 18 "display_name", | 18 "display_name", |
| 19 "process-group", | |
| 20 ] | 19 ] |
| 21 | 20 |
| 22 eater_relative = '../../../../../../tools/json_comment_eater' | 21 eater_relative = '../../../../../../tools/json_comment_eater' |
| 23 eater_relative = os.path.join(os.path.abspath(__file__), eater_relative) | 22 eater_relative = os.path.join(os.path.abspath(__file__), eater_relative) |
| 24 sys.path.insert(0, os.path.normpath(eater_relative)) | 23 sys.path.insert(0, os.path.normpath(eater_relative)) |
| 25 try: | 24 try: |
| 26 import json_comment_eater | 25 import json_comment_eater |
| 27 finally: | 26 finally: |
| 28 sys.path.pop(0) | 27 sys.path.pop(0) |
| 29 | 28 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 for overlay_path in args.overlays: | 97 for overlay_path in args.overlays: |
| 99 MergeManifestOverlay(parent, ParseJSONFile(overlay_path)) | 98 MergeManifestOverlay(parent, ParseJSONFile(overlay_path)) |
| 100 | 99 |
| 101 with open(args.output, 'w') as output_file: | 100 with open(args.output, 'w') as output_file: |
| 102 json.dump(parent, output_file) | 101 json.dump(parent, output_file) |
| 103 | 102 |
| 104 return 0 | 103 return 0 |
| 105 | 104 |
| 106 if __name__ == "__main__": | 105 if __name__ == "__main__": |
| 107 sys.exit(main()) | 106 sys.exit(main()) |
| OLD | NEW |