| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Generator for C++ structs from api json files. | 5 """Generator for C++ structs from api json files. |
| 6 | 6 |
| 7 The purpose of this tool is to remove the need for hand-written code that | 7 The purpose of this tool is to remove the need for hand-written code that |
| 8 converts to and from base::Value types when receiving javascript api calls. | 8 converts to and from base::Value types when receiving javascript api calls. |
| 9 Originally written for generating code for extension apis. Reference schemas | 9 Originally written for generating code for extension apis. Reference schemas |
| 10 are in chrome/common/extensions/api. | 10 are in chrome/common/extensions/api. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 if not args: | 199 if not args: |
| 200 sys.exit(0) # This is OK as a no-op | 200 sys.exit(0) # This is OK as a no-op |
| 201 dest_dir = opts.destdir | 201 dest_dir = opts.destdir |
| 202 root_namespace = opts.namespace | 202 root_namespace = opts.namespace |
| 203 | 203 |
| 204 if opts.bundle: | 204 if opts.bundle: |
| 205 handle_bundle_schema(args, dest_dir, opts.root, root_namespace) | 205 handle_bundle_schema(args, dest_dir, opts.root, root_namespace) |
| 206 else: | 206 else: |
| 207 handle_single_schema(args[0], dest_dir, opts.root, root_namespace) | 207 handle_single_schema(args[0], dest_dir, opts.root, root_namespace) |
| OLD | NEW |