diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-02 14:02:54 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-02 14:02:54 +0000 |
commit | db943991442923e0508931233865b36bc3d0d251 (patch) | |
tree | eb3494ab2c4aa0f1957ffcd8cb851db2773c24cc /tools | |
parent | 64527a5d86547911117883a9a442c21830b37260 (diff) | |
download | chromium_src-db943991442923e0508931233865b36bc3d0d251.zip chromium_src-db943991442923e0508931233865b36bc3d0d251.tar.gz chromium_src-db943991442923e0508931233865b36bc3d0d251.tar.bz2 |
Extension docs server: fix the rendering of webstore.html.
TBR=cduvall@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10837073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/json_schema_compiler/model.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py index b7a094a5..76b27b2 100644 --- a/tools/json_schema_compiler/model.py +++ b/tools/json_schema_compiler/model.py @@ -129,14 +129,27 @@ class Function(object): self.optional = json.get('optional', False) self.parent = parent self.nocompile = json.get('nocompile') + + callback_param = None for param in json.get('parameters', []): + def GeneratePropertyFromParam(p): + return Property(self, + p['name'], p, + from_json=from_json, + from_client=from_client) + if param.get('type') == 'function': - if self.callback: - raise ParseException(self, self.name + " has more than one callback") - self.callback = Function(self, param, from_client=True) + if callback_param: + # No ParseException because the webstore has this. + # Instead, pretend all intermediate callbacks are properties. + self.params.append(GeneratePropertyFromParam(callback_param)) + callback_param = param else: - self.params.append(Property(self, param['name'], param, - from_json=from_json, from_client=from_client)) + self.params.append(GeneratePropertyFromParam(param)) + + if callback_param: + self.callback = Function(self, callback_param, from_client=True) + self.returns = None if 'returns' in json: self.returns = Property(self, 'return', json['returns']) |