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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10780027: JSON schema compiler: Read the "optional" property out of the JSON for Function. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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 | « no previous file | 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 828481f2725c7724238a5598127a303298054697..a35d15e4fa6e40944e29838df835b17a496c7ce1 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -114,12 +114,15 @@ class Function(object):
- |description| a description of the function (if provided)
- |callback| the callback parameter to the function. There should be exactly
one
+ - |optional| whether the Function is "optional"; this only makes sense to be
+ present when the Function is representing a callback property.
"""
def __init__(self, parent, json, from_json=False, from_client=False):
self.name = json['name']
self.params = []
self.description = json.get('description')
self.callback = None
+ self.optional = json.get('optional', False)
self.parent = parent
self.nocompile = json.get('nocompile')
for param in json.get('parameters', []):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698