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 '''Container nodes that don't have any logic. | 6 '''Container nodes that don't have any logic. |
7 ''' | 7 ''' |
8 | 8 |
9 | 9 |
10 from grit.node import base | 10 from grit.node import base |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 '''Return the stringtable itemformatter if an RC is being formatted.''' | 42 '''Return the stringtable itemformatter if an RC is being formatted.''' |
43 if t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: | 43 if t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: |
44 from grit.format import rc # avoid circular dep by importing here | 44 from grit.format import rc # avoid circular dep by importing here |
45 return rc.StringTable() | 45 return rc.StringTable() |
46 elif t == 'c_format': | 46 elif t == 'c_format': |
47 from grit.format import c_format | 47 from grit.format import c_format |
48 return c_format.StringTable() | 48 return c_format.StringTable() |
49 elif t == 'js_map_format': | 49 elif t == 'js_map_format': |
50 from grit.format import js_map_format | 50 from grit.format import js_map_format |
51 return js_map_format.StringTable() | 51 return js_map_format.StringTable() |
| 52 elif t == 'chrome_messages_json': |
| 53 from grit.format import chrome_messages_json |
| 54 return chrome_messages_json.StringTable() |
52 elif t == 'android': | 55 elif t == 'android': |
53 from grit.format import android_xml | 56 from grit.format import android_xml |
54 return android_xml.ResourcesElement() | 57 return android_xml.ResourcesElement() |
55 | 58 |
56 | 59 |
57 class StructuresNode(GroupingNode): | 60 class StructuresNode(GroupingNode): |
58 '''The <structures> element.''' | 61 '''The <structures> element.''' |
59 def _IsValidChild(self, child): | 62 def _IsValidChild(self, child): |
60 return isinstance(child, (structure.StructureNode, misc.SplicingNode)) | 63 return isinstance(child, (structure.StructureNode, misc.SplicingNode)) |
61 | 64 |
62 | 65 |
63 class TranslationsNode(base.Node): | 66 class TranslationsNode(base.Node): |
64 '''The <translations> element.''' | 67 '''The <translations> element.''' |
65 def _IsValidChild(self, child): | 68 def _IsValidChild(self, child): |
66 return isinstance(child, (io.FileNode, misc.SplicingNode)) | 69 return isinstance(child, (io.FileNode, misc.SplicingNode)) |
67 | 70 |
68 | 71 |
69 class OutputsNode(base.Node): | 72 class OutputsNode(base.Node): |
70 '''The <outputs> element.''' | 73 '''The <outputs> element.''' |
71 def _IsValidChild(self, child): | 74 def _IsValidChild(self, child): |
72 return isinstance(child, (io.OutputNode, misc.SplicingNode)) | 75 return isinstance(child, (io.OutputNode, misc.SplicingNode)) |
73 | 76 |
74 | 77 |
75 class IdentifiersNode(GroupingNode): | 78 class IdentifiersNode(GroupingNode): |
76 '''The <identifiers> element.''' | 79 '''The <identifiers> element.''' |
77 def _IsValidChild(self, child): | 80 def _IsValidChild(self, child): |
78 from grit.node import misc | 81 from grit.node import misc |
79 return isinstance(child, misc.IdentifierNode) | 82 return isinstance(child, misc.IdentifierNode) |
OLD | NEW |