Chromium Code Reviews| Index: tools/json_schema_compiler/model.py |
| diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py |
| index a7aaac32dc2c1fef9674dbd8b10fd8766e417edd..7b37466ecce5e505fce5d2e62a6ea7a6c15bed28 100644 |
| --- a/tools/json_schema_compiler/model.py |
| +++ b/tools/json_schema_compiler/model.py |
| @@ -229,6 +229,7 @@ class Property(object): |
| self.from_json = from_json |
| self.from_client = from_client |
| self.instance_of = json.get('isInstanceOf', None) |
| + self.params = [] |
|
Aaron Boodman
2012/10/24 22:29:24
I wonder if we also need to model the return value
cduvall
2012/10/25 23:42:02
Done.
|
| _AddProperties(self, json, namespace) |
| if is_additional_properties: |
| self.type_ = PropertyType.ADDITIONAL_PROPERTIES |
| @@ -257,6 +258,14 @@ class Property(object): |
| # self.properties will already have some value from |_AddProperties|. |
| self.properties.update(type_.properties) |
| self.functions = type_.functions |
| + elif self.type_ == PropertyType.FUNCTION: |
| + for p in json.get('parameters', []): |
| + self.params.append(Property(self, |
| + p['name'], |
| + p, |
| + namespace, |
| + from_json=from_json, |
| + from_client=from_client)) |
| elif 'choices' in json: |
| if not json['choices'] or len(json['choices']) == 0: |
| raise ParseException(self, 'Choices has no choices') |