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

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

Issue 233004: Only generate grit header id values for messages that are (Closed)
Patch Set: cleanup Created 11 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/node/message.py
diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py
index 9410f93b899506254e5ba06527ba39c7d35333b0..8cdf0efa39d5420062b07c3fc9d7a69e49eea885 100644
--- a/tools/grit/grit/node/message.py
+++ b/tools/grit/grit/node/message.py
@@ -99,12 +99,15 @@ class MessageNode(base.ContentNode):
return self.attrs['translateable'] == 'true'
def ItemFormatter(self, t):
+ # Only generate an output if the if condition is satisfied.
+ if not self.SatisfiesOutputCondition():
+ return super(type(self), self).ItemFormatter(t)
+
if t == 'rc_header':
return grit.format.rc_header.Item()
- elif (t in ['rc_all', 'rc_translateable', 'rc_nontranslateable'] and
- self.SatisfiesOutputCondition()):
+ elif t in ('rc_all', 'rc_translateable', 'rc_nontranslateable'):
return grit.format.rc.Message()
- elif t == 'js_map_format' and self.SatisfiesOutputCondition():
+ elif t == 'js_map_format':
return grit.format.js_map_format.Message()
else:
return super(type(self), self).ItemFormatter(t)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698