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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10837073: Extension docs server: fix the rendering of webstore.html. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « chrome/common/extensions/docs/server2/templates/private/callback.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index b7a094a5b72ff289a5f18799296cb7ccdcf33473..76b27b20556e2009feb65bf822dc726391bd378b 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'])
« no previous file with comments | « chrome/common/extensions/docs/server2/templates/private/callback.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698