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 12 matching lines...) Expand all Loading... |
23 'first_id' : '', | 23 'first_id' : '', |
24 'comment' : '', | 24 'comment' : '', |
25 'fallback_to_english' : 'false', | 25 'fallback_to_english' : 'false', |
26 'fallback_to_low_resolution' : 'false', | 26 'fallback_to_low_resolution' : 'false', |
27 } | 27 } |
28 | 28 |
29 | 29 |
30 class IncludesNode(GroupingNode): | 30 class IncludesNode(GroupingNode): |
31 '''The <includes> element.''' | 31 '''The <includes> element.''' |
32 def _IsValidChild(self, child): | 32 def _IsValidChild(self, child): |
33 return isinstance(child, (include.IncludeNode, misc.SplicingNode)) | 33 return isinstance(child, (include.IncludeNode, misc.IfNode, misc.PartNode)) |
34 | 34 |
35 | 35 |
36 class MessagesNode(GroupingNode): | 36 class MessagesNode(GroupingNode): |
37 '''The <messages> element.''' | 37 '''The <messages> element.''' |
38 def _IsValidChild(self, child): | 38 def _IsValidChild(self, child): |
39 return isinstance(child, (message.MessageNode, misc.SplicingNode)) | 39 return isinstance(child, (message.MessageNode, misc.IfNode, misc.PartNode)) |
40 | 40 |
41 | 41 |
42 class StructuresNode(GroupingNode): | 42 class StructuresNode(GroupingNode): |
43 '''The <structures> element.''' | 43 '''The <structures> element.''' |
44 def _IsValidChild(self, child): | 44 def _IsValidChild(self, child): |
45 return isinstance(child, (structure.StructureNode, misc.SplicingNode)) | 45 return isinstance(child, (structure.StructureNode, |
| 46 misc.IfNode, misc.PartNode)) |
46 | 47 |
47 | 48 |
48 class TranslationsNode(base.Node): | 49 class TranslationsNode(base.Node): |
49 '''The <translations> element.''' | 50 '''The <translations> element.''' |
50 def _IsValidChild(self, child): | 51 def _IsValidChild(self, child): |
51 return isinstance(child, (io.FileNode, misc.SplicingNode)) | 52 return isinstance(child, (io.FileNode, misc.IfNode, misc.PartNode)) |
52 | 53 |
53 | 54 |
54 class OutputsNode(base.Node): | 55 class OutputsNode(base.Node): |
55 '''The <outputs> element.''' | 56 '''The <outputs> element.''' |
56 def _IsValidChild(self, child): | 57 def _IsValidChild(self, child): |
57 return isinstance(child, (io.OutputNode, misc.SplicingNode)) | 58 return isinstance(child, (io.OutputNode, misc.IfNode, misc.PartNode)) |
58 | 59 |
59 | 60 |
60 class IdentifiersNode(GroupingNode): | 61 class IdentifiersNode(GroupingNode): |
61 '''The <identifiers> element.''' | 62 '''The <identifiers> element.''' |
62 def _IsValidChild(self, child): | 63 def _IsValidChild(self, child): |
63 from grit.node import misc | |
64 return isinstance(child, misc.IdentifierNode) | 64 return isinstance(child, misc.IdentifierNode) |
OLD | NEW |