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

Side by Side Diff: mojo/public/tools/manifest/manifest_collator.py

Issue 1871223003: Use ShellClientFactory interface to load mojo:profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « content/public/browser/browser_context.h ('k') | services/shell/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Mojo Application Manifests """ 6 """ A collator for Mojo Application Manifests """
7 7
8 import argparse 8 import argparse
9 import json 9 import json
10 import shutil 10 import shutil
(...skipping 22 matching lines...) Expand all
33 assert isinstance(left[k], list) 33 assert isinstance(left[k], list)
34 left[k].extend(v) 34 left[k].extend(v)
35 else: 35 else:
36 raise "Refusing to merge conflicting non-collection values." 36 raise "Refusing to merge conflicting non-collection values."
37 return left 37 return left
38 38
39 39
40 def MergeBaseManifest(parent, base): 40 def MergeBaseManifest(parent, base):
41 MergeDicts(parent["capabilities"], base["capabilities"]) 41 MergeDicts(parent["capabilities"], base["capabilities"])
42 42
43 if "applications" in base:
44 if "applications" not in parent:
45 parent["applications"] = []
46 parent["applications"].extend(base["applications"])
47
48 if "process-group" in base:
49 parent["process-group"] = base["process-group"]
50
43 51
44 def main(): 52 def main():
45 parser = argparse.ArgumentParser( 53 parser = argparse.ArgumentParser(
46 description="Collate Mojo application manifests.") 54 description="Collate Mojo application manifests.")
47 parser.add_argument("--parent") 55 parser.add_argument("--parent")
48 parser.add_argument("--output") 56 parser.add_argument("--output")
49 parser.add_argument("--application-name") 57 parser.add_argument("--application-name")
50 parser.add_argument("--base-manifest", default=None) 58 parser.add_argument("--base-manifest", default=None)
51 args, children = parser.parse_known_args() 59 args, children = parser.parse_known_args()
52 60
(...skipping 27 matching lines...) Expand all
80 if len(applications) > 0: 88 if len(applications) > 0:
81 parent['applications'] = applications 89 parent['applications'] = applications
82 90
83 with open(args.output, 'w') as output_file: 91 with open(args.output, 'w') as output_file:
84 json.dump(parent, output_file) 92 json.dump(parent, output_file)
85 93
86 return 0 94 return 0
87 95
88 if __name__ == "__main__": 96 if __name__ == "__main__":
89 sys.exit(main()) 97 sys.exit(main())
OLDNEW
« no previous file with comments | « content/public/browser/browser_context.h ('k') | services/shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698