Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1131)

Unified Diff: tools/grit/grit/node/empty.py

Issue 1410853008: Move grit from DEPS into src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webview licenses Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/grit/grit/node/custom/filename_unittest.py ('k') | tools/grit/grit/node/include.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/node/empty.py
diff --git a/tools/grit/grit/node/empty.py b/tools/grit/grit/node/empty.py
new file mode 100755
index 0000000000000000000000000000000000000000..b3759a27cebcbfd7e7fa6829f2838aba264b0261
--- /dev/null
+++ b/tools/grit/grit/node/empty.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+'''Container nodes that don't have any logic.
+'''
+
+
+from grit.node import base
+from grit.node import include
+from grit.node import structure
+from grit.node import message
+from grit.node import io
+from grit.node import misc
+
+
+class GroupingNode(base.Node):
+ '''Base class for all the grouping elements (<structures>, <includes>,
+ <messages> and <identifiers>).'''
+ def DefaultAttributes(self):
+ return {
+ 'first_id' : '',
+ 'comment' : '',
+ 'fallback_to_english' : 'false',
+ 'fallback_to_low_resolution' : 'false',
+ }
+
+
+class IncludesNode(GroupingNode):
+ '''The <includes> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, (include.IncludeNode, misc.IfNode, misc.PartNode))
+
+
+class MessagesNode(GroupingNode):
+ '''The <messages> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, (message.MessageNode, misc.IfNode, misc.PartNode))
+
+
+class StructuresNode(GroupingNode):
+ '''The <structures> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, (structure.StructureNode,
+ misc.IfNode, misc.PartNode))
+
+
+class TranslationsNode(base.Node):
+ '''The <translations> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, (io.FileNode, misc.IfNode, misc.PartNode))
+
+
+class OutputsNode(base.Node):
+ '''The <outputs> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, (io.OutputNode, misc.IfNode, misc.PartNode))
+
+
+class IdentifiersNode(GroupingNode):
+ '''The <identifiers> element.'''
+ def _IsValidChild(self, child):
+ return isinstance(child, misc.IdentifierNode)
« no previous file with comments | « tools/grit/grit/node/custom/filename_unittest.py ('k') | tools/grit/grit/node/include.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698