OLD | NEW |
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 sys | 6 import sys |
7 | 7 |
8 # | 8 # |
9 # IDL Node | 9 # IDL Node |
10 # | 10 # |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 for child in children: | 194 for child in children: |
195 if not child: | 195 if not child: |
196 continue | 196 continue |
197 if type(child) == IDLAttribute: | 197 if type(child) == IDLAttribute: |
198 self.SetProperty(child.name, child.value) | 198 self.SetProperty(child.name, child.value) |
199 continue | 199 continue |
200 if type(child) == IDLNode: | 200 if type(child) == IDLNode: |
201 child._parent = self | 201 child._parent = self |
202 self._children.append(child) | 202 self._children.append(child) |
203 continue | 203 continue |
204 raise RuntimeError('Adding child of type .\n' % type(child).__name__) | 204 raise RuntimeError('Adding child of type %s.\n' % type(child).__name__) |
205 | 205 |
206 | 206 |
207 # | 207 # |
208 # Property Functions | 208 # Property Functions |
209 # | 209 # |
210 def SetProperty(self, name, val): | 210 def SetProperty(self, name, val): |
211 self._properties[name] = val | 211 self._properties[name] = val |
212 | 212 |
213 def GetProperty(self, name, default=None): | 213 def GetProperty(self, name, default=None): |
214 return self._properties.get(name, default) | 214 return self._properties.get(name, default) |
215 | 215 |
216 def GetProperties(self): | 216 def GetProperties(self): |
217 return self._properties | 217 return self._properties |
OLD | NEW |