| 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 '''Miscellaneous node types. | 6 '''Miscellaneous node types. |
| 7 ''' | 7 ''' |
| 8 | 8 |
| 9 import os.path | 9 import os.path |
| 10 import re | 10 import re |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return output_files | 291 return output_files |
| 292 raise exception.MissingElement() | 292 raise exception.MissingElement() |
| 293 | 293 |
| 294 def ItemFormatter(self, t): | 294 def ItemFormatter(self, t): |
| 295 if t == 'rc_header': | 295 if t == 'rc_header': |
| 296 from grit.format import rc_header # import here to avoid circular dep | 296 from grit.format import rc_header # import here to avoid circular dep |
| 297 return rc_header.TopLevel() | 297 return rc_header.TopLevel() |
| 298 elif t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: | 298 elif t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: |
| 299 from grit.format import rc # avoid circular dep | 299 from grit.format import rc # avoid circular dep |
| 300 return rc.TopLevel() | 300 return rc.TopLevel() |
| 301 elif t == 'c_format': |
| 302 from grit.format import c_format |
| 303 return c_format.TopLevel() |
| 301 elif t == 'resource_map_header': | 304 elif t == 'resource_map_header': |
| 302 from grit.format import resource_map | 305 from grit.format import resource_map |
| 303 return resource_map.HeaderTopLevel() | 306 return resource_map.HeaderTopLevel() |
| 304 elif t in ('resource_map_source', 'resource_file_map_source'): | 307 elif t in ('resource_map_source', 'resource_file_map_source'): |
| 305 from grit.format import resource_map | 308 from grit.format import resource_map |
| 306 return resource_map.SourceTopLevel() | 309 return resource_map.SourceTopLevel() |
| 307 elif t == 'js_map_format': | 310 elif t == 'js_map_format': |
| 308 from grit.format import js_map_format | 311 from grit.format import js_map_format |
| 309 return js_map_format.TopLevel() | 312 return js_map_format.TopLevel() |
| 310 elif t in ('adm', 'plist', 'plist_strings', 'admx', 'adml', 'doc', 'json', | 313 elif t in ('adm', 'plist', 'plist_strings', 'admx', 'adml', 'doc', 'json', |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 by parameters of the same name. | 400 by parameters of the same name. |
| 398 ''' | 401 ''' |
| 399 node = IdentifierNode() | 402 node = IdentifierNode() |
| 400 node.StartParsing('identifier', parent) | 403 node.StartParsing('identifier', parent) |
| 401 node.HandleAttribute('name', name) | 404 node.HandleAttribute('name', name) |
| 402 node.HandleAttribute('id', id) | 405 node.HandleAttribute('id', id) |
| 403 node.HandleAttribute('comment', comment) | 406 node.HandleAttribute('comment', comment) |
| 404 node.EndParsing() | 407 node.EndParsing() |
| 405 return node | 408 return node |
| 406 Construct = staticmethod(Construct) | 409 Construct = staticmethod(Construct) |
| OLD | NEW |