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

Unified Diff: third_party/WebKit/Source/build/scripts/json5_generator.py

Issue 2815773003: Make json5_generator.Writer always take a list of files. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_css_property_apis.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/json5_generator.py
diff --git a/third_party/WebKit/Source/build/scripts/json5_generator.py b/third_party/WebKit/Source/build/scripts/json5_generator.py
index 5b7184b3264ab86bfaa9e87747c753c573526882..6dedef6cec905ca783fbcacb2089e2ba2b936070 100644
--- a/third_party/WebKit/Source/build/scripts/json5_generator.py
+++ b/third_party/WebKit/Source/build/scripts/json5_generator.py
@@ -99,7 +99,10 @@ class Json5File(object):
self._process(doc)
@classmethod
- def load_from_files(cls, file_paths, default_metadata, default_parameters=None):
+ def load_from_files(cls, file_paths, default_metadata=None, default_parameters=None):
+ if isinstance(file_paths, basestring):
+ file_paths = [file_paths]
+
merged_doc = dict()
for path in file_paths:
assert path.endswith(".json5")
@@ -196,8 +199,6 @@ class Writer(object):
def __init__(self, json5_files):
self._outputs = {} # file_name -> generator
self.gperf_path = None
- if isinstance(json5_files, basestring):
- json5_files = [json5_files]
alancutter (OOO until 2018) 2017/04/13 03:23:52 This code (that existed) smells bad. Are we certai
shend 2017/04/13 03:57:43 Done.
if json5_files:
self.json5_file = Json5File.load_from_files(json5_files,
self.default_metadata,
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_css_property_apis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698