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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10639020: Switch the downloads API over to IDL/json_schema_compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
Index: tools/json_schema_compiler/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index 1b353ac74a0589aa39ac546f9851c9c84b793e1b..4aad4c16761e09cff31604641d88ff61f8be4dab 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -190,7 +190,10 @@ class Property(object):
elif '$ref' in json:
self.ref_type = json['$ref']
self.type_ = PropertyType.REF
- elif 'enum' in json:
+ elif 'enum' in json and all(isinstance(value, basestring)
asargent_no_longer_on_chrome 2012/07/02 23:43:48 This isinstance test seems kind of hacky - can we
benjhayden 2012/07/09 20:18:09 Done.
+ for value in json['enum']):
+ # If enum values are not all strings (as in the case of
+ # [legalValues=(1,2)]), fall through to the next elif.
self.enum_values = []
for value in json['enum']:
self.enum_values.append(value)

Powered by Google App Engine
This is Rietveld 408576698