OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import os.path | 6 import os.path |
7 import re | 7 import re |
8 | 8 |
9 from json_parse import OrderedDict | 9 from json_parse import OrderedDict |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 Properties: | 128 Properties: |
129 - |name| the function name | 129 - |name| the function name |
130 - |params| a list of parameters to the function (order matters). A separate | 130 - |params| a list of parameters to the function (order matters). A separate |
131 parameter is used for each choice of a 'choices' parameter. | 131 parameter is used for each choice of a 'choices' parameter. |
132 - |description| a description of the function (if provided) | 132 - |description| a description of the function (if provided) |
133 - |callback| the callback parameter to the function. There should be exactly | 133 - |callback| the callback parameter to the function. There should be exactly |
134 one | 134 one |
135 - |optional| whether the Function is "optional"; this only makes sense to be | 135 - |optional| whether the Function is "optional"; this only makes sense to be |
136 present when the Function is representing a callback property. | 136 present when the Function is representing a callback property. |
137 - |simple_name| the name of this Function without a namespace | 137 - |simple_name| the name of this Function without a namespace |
| 138 - |returns| the return type of the function; None if the function does not |
| 139 return a value |
138 """ | 140 """ |
139 def __init__(self, | 141 def __init__(self, |
140 parent, | 142 parent, |
141 json, | 143 json, |
142 namespace, | 144 namespace, |
143 from_json=False, | 145 from_json=False, |
144 from_client=False): | 146 from_client=False): |
145 self.name = json['name'] | 147 self.name = json['name'] |
146 self.simple_name = _StripNamespace(self.name, namespace) | 148 self.simple_name = _StripNamespace(self.name, namespace) |
147 self.params = [] | 149 self.params = [] |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 """ | 456 """ |
455 model.properties = OrderedDict() | 457 model.properties = OrderedDict() |
456 for name, property_json in json.get('properties', {}).items(): | 458 for name, property_json in json.get('properties', {}).items(): |
457 model.properties[name] = Property( | 459 model.properties[name] = Property( |
458 model, | 460 model, |
459 name, | 461 name, |
460 property_json, | 462 property_json, |
461 namespace, | 463 namespace, |
462 from_json=from_json, | 464 from_json=from_json, |
463 from_client=from_client) | 465 from_client=from_client) |
OLD | NEW |