Chromium Code Reviews| Index: tools/json_schema_compiler/idl_schema.py |
| diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py |
| index 44a4a55eaec8e06523919a621c9e450aeaa6637e..4cedc421d275af1912e113d5bfaa9b7ddc24ea57 100644 |
| --- a/tools/json_schema_compiler/idl_schema.py |
| +++ b/tools/json_schema_compiler/idl_schema.py |
| @@ -313,10 +313,12 @@ class Namespace(object): |
| dictionary that the JSON schema compiler expects to see. |
| ''' |
| - def __init__(self, namespace_node, description, nodoc=False, internal=False): |
| + def __init__(self, namespace_node, description, nodoc=False, internal=False, |
| + platforms=[]): |
|
not at google - send to devlin
2013/10/25 17:00:08
don't set optional parameters to mutable objects,
Haojian Wu
2013/10/26 03:15:51
Done.
|
| self.namespace = namespace_node |
| self.nodoc = nodoc |
| self.internal = internal |
| + self.platforms = platforms |
| self.events = [] |
| self.functions = [] |
| self.types = [] |
| @@ -344,7 +346,8 @@ class Namespace(object): |
| 'types': self.types, |
| 'functions': self.functions, |
| 'internal': self.internal, |
| - 'events': self.events} |
| + 'events': self.events, |
| + 'platforms': self.platforms} |
| def process_interface(self, node): |
| members = [] |
| @@ -369,6 +372,7 @@ class IDLSchema(object): |
| nodoc = False |
| internal = False |
| description = None |
| + platforms = [] |
|
not at google - send to devlin
2013/10/25 17:00:08
None
Haojian Wu
2013/10/26 03:15:51
Done.
|
| for node in self.idl: |
| if node.cls == 'Namespace': |
| if not description: |
| @@ -376,7 +380,7 @@ class IDLSchema(object): |
| print('%s must have a namespace-level comment. This will ' |
| 'appear on the API summary page.' % node.GetName()) |
| description = '' |
| - namespace = Namespace(node, description, nodoc, internal) |
| + namespace = Namespace(node, description, nodoc, internal, platforms) |
| namespaces.append(namespace.process()) |
| nodoc = False |
| internal = False |
|
not at google - send to devlin
2013/10/25 17:00:08
platforms = None here?
Haojian Wu
2013/10/26 03:15:51
Done. I forget to reset it here.
|
| @@ -389,6 +393,8 @@ class IDLSchema(object): |
| nodoc = bool(node.value) |
| elif node.name == 'internal': |
| internal = bool(node.value) |
| + elif node.name == 'platforms': |
| + platforms = list(node.value) |
| else: |
| continue |
| else: |