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

Side by Side Diff: tools/json_schema_compiler/idl_schema.py

Issue 10217018: Alarm resolution changed to minutes and minimum delay added. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sinked. Created 8 years, 7 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 unified diff | Download patch
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import json 6 import json
7 import os.path 7 import os.path
8 import sys 8 import sys
9 import re 9 import re
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if sibling.cls == 'Array' and sibling.GetName() == self.parent.GetName(): 154 if sibling.cls == 'Array' and sibling.GetName() == self.parent.GetName():
155 properties['type'] = 'array' 155 properties['type'] = 'array'
156 properties['items'] = {} 156 properties['items'] = {}
157 properties = properties['items'] 157 properties = properties['items']
158 break 158 break
159 159
160 if self.typeref == 'DOMString': 160 if self.typeref == 'DOMString':
161 properties['type'] = 'string' 161 properties['type'] = 'string'
162 elif self.typeref == 'boolean': 162 elif self.typeref == 'boolean':
163 properties['type'] = 'boolean' 163 properties['type'] = 'boolean'
164 elif self.typeref == 'double':
165 properties['type'] = 'number'
164 elif self.typeref == 'long': 166 elif self.typeref == 'long':
165 properties['type'] = 'integer' 167 properties['type'] = 'integer'
166 elif self.typeref == 'any': 168 elif self.typeref == 'any':
167 properties['type'] = 'any' 169 properties['type'] = 'any'
168 elif self.typeref == 'object': 170 elif self.typeref == 'object':
169 properties['type'] = 'object' 171 properties['type'] = 'object'
170 if 'additionalProperties' not in properties: 172 if 'additionalProperties' not in properties:
171 properties['additionalProperties'] = {} 173 properties['additionalProperties'] = {}
172 properties['additionalProperties']['type'] = 'any' 174 properties['additionalProperties']['type'] = 'any'
173 instance_of = self.parent.GetProperty('instanceOf') 175 instance_of = self.parent.GetProperty('instanceOf')
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 ''' 276 '''
275 Dump a json serialization of parse result for the IDL files whose names 277 Dump a json serialization of parse result for the IDL files whose names
276 were passed in on the command line. 278 were passed in on the command line.
277 ''' 279 '''
278 for filename in sys.argv[1:]: 280 for filename in sys.argv[1:]:
279 schema = Load(filename) 281 schema = Load(filename)
280 print json.dumps(schema, indent=2) 282 print json.dumps(schema, indent=2)
281 283
282 if __name__ == '__main__': 284 if __name__ == '__main__':
283 Main() 285 Main()
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698