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

Unified Diff: grit/node/misc.py

Issue 1194063002: grit: Add fallback_to_default_layout attribute to <output> (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 5 years, 6 months 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
« grit/node/io.py ('K') | « grit/node/io.py ('k') | grit/tool/build.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/node/misc.py
diff --git a/grit/node/misc.py b/grit/node/misc.py
index 64c469063dc8980f969ee09ecdcfc891e0e43052..8a0b46f53de370b0c2fe8f0f7978f3b43b402c06 100755
--- a/grit/node/misc.py
+++ b/grit/node/misc.py
@@ -323,9 +323,11 @@ class GritNode(base.Node):
# Check if the input is required for any output configuration.
input_files = set()
old_output_language = self.output_language
- for lang, ctx in self.GetConfigurations():
+ for lang, ctx, fallback in self.GetConfigurations():
self.SetOutputLanguage(lang or self.GetSourceLanguage())
self.SetOutputContext(ctx)
+ self.SetFallbackToDefaultLayout(fallback)
+
for node in self.ActiveDescendants():
if isinstance(node, (io.FileNode, include.IncludeNode, misc.PartNode,
structure.StructureNode, variant.SkeletonNode)):
@@ -364,9 +366,10 @@ class GritNode(base.Node):
raise exception.MissingElement()
def GetConfigurations(self):
- """Returns the distinct (language, context) pairs from the output nodes.
+ """Returns the distinct (language, context, fallback_to_default_layout)
+ triples from the output nodes.
"""
- return set((n.GetLanguage(), n.GetContext()) for n in self.GetOutputFiles())
+ return set((n.GetLanguage(), n.GetContext(), n.GetFallbackToDefaultLayout()) for n in self.GetOutputFiles())
def GetSubstitutionMessages(self):
"""Returns the list of <message sub_variable="true"> nodes."""
@@ -397,6 +400,10 @@ class GritNode(base.Node):
self.output_context = output_context
self.substituter = None # force recalculate
+ def SetFallbackToDefaultLayout(self, fallback_to_default_layout):
+ self.fallback_to_default_layout = fallback_to_default_layout
+ self.substituter = None # force recalculate
+
def SetDefines(self, defines):
self.defines = defines
self.substituter = None # force recalculate
« grit/node/io.py ('K') | « grit/node/io.py ('k') | grit/tool/build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698