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

Side by Side Diff: trunk/src/tools/json_schema_compiler/schema_loader.py

Issue 25940002: Revert 226826 "This is a preliminary patch to auto-generate the ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
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 os 5 import os
6 import sys 6 import sys
7 7
8 import idl_schema 8 import idl_schema
9 import json_schema 9 import json_schema
10 from model import Model 10 from model import Model
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 schema_filename, schema_extension = os.path.splitext(schema) 52 schema_filename, schema_extension = os.path.splitext(schema)
53 53
54 schema_path = os.path.join(self._real_path, schema); 54 schema_path = os.path.join(self._real_path, schema);
55 if schema_extension == '.json': 55 if schema_extension == '.json':
56 api_defs = json_schema.Load(schema_path) 56 api_defs = json_schema.Load(schema_path)
57 elif schema_extension == '.idl': 57 elif schema_extension == '.idl':
58 api_defs = idl_schema.Load(schema_path) 58 api_defs = idl_schema.Load(schema_path)
59 else: 59 else:
60 sys.exit('Did not recognize file extension %s for schema %s' % 60 sys.exit('Did not recognize file extension %s for schema %s' %
61 (schema_extension, schema)) 61 (schema_extension, schema))
62 if len(api_defs) != 1:
63 sys.exit('File %s has multiple schemas. Files are only allowed to contain'
64 'a single schema.' % schema)
62 65
63 return api_defs 66 return api_defs
OLDNEW
« no previous file with comments | « trunk/src/tools/json_schema_compiler/model.py ('k') | trunk/src/tools/json_schema_compiler/test/features_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698