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

Unified Diff: CodeGenerator.py

Issue 2482093004: [inspector_protocol] Allow overriding specific config values. (Closed)
Patch Set: typo Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | inspector_protocol.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: CodeGenerator.py
diff --git a/CodeGenerator.py b/CodeGenerator.py
index 4a0ecbef770eca3e670c9bcb4d80c179ce49192f..38cd846b1b5f0643b4890abffaa0c152263bdd54 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
« no previous file with comments | « no previous file | inspector_protocol.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698