Chromium Code Reviews| Index: CodeGenerator.py |
| diff --git a/CodeGenerator.py b/CodeGenerator.py |
| index 4a0ecbef770eca3e670c9bcb4d80c179ce49192f..fa3aa237ee88f710e2ca492262384b5431d38c8a 100644 |
| --- a/CodeGenerator.py |
| +++ b/CodeGenerator.py |
| @@ -52,6 +52,7 @@ def read_config(): |
| cmdline_parser.add_option("--output_base") |
| cmdline_parser.add_option("--jinja_dir") |
| cmdline_parser.add_option("--config") |
| + cmdline_parser.add_option("--config_value", action="append", type="string") |
| arg_options, _ = cmdline_parser.parse_args() |
| jinja_dir = arg_options.jinja_dir |
| if not jinja_dir: |
| @@ -63,6 +64,7 @@ def read_config(): |
| if not config_file: |
| raise Exception("Config file name must be specified") |
| config_base = os.path.dirname(config_file) |
| + config_values = arg_options.config_value |
| except Exception: |
| # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html |
| exc = sys.exc_info()[1] |
| @@ -90,6 +92,10 @@ def read_config(): |
| ".lib.export_macro": "", |
| ".lib.export_header": False, |
| } |
| + for key_value in config_values: |
| + parts = key_value.split("=") |
| + if len(parts) == 2: |
| + defaults["." + parts[0]] = parts[1] |
| return (jinja_dir, config_file, init_defaults(config_partial, "", defaults)) |
| except Exception: |
| # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html |
| @@ -287,6 +293,7 @@ def wrap_array_definition(type): |
| "raw_type": "protocol::Array<%s>" % type["raw_type"], |
| "raw_pass_type": "protocol::Array<%s>*" % type["raw_type"], |
| "raw_return_type": "protocol::Array<%s>*" % type["raw_type"], |
| + "create_type": "wrapUnique(new protocol::Array<%s>())" % type["raw_type"], |
|
kozy
2016/11/08 23:13:43
Hm...
dgozman
2016/11/08 23:19:36
Accidental. Removed.
|
| "out_type": "protocol::Array<%s>&" % type["raw_type"], |
| } |