diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 17:47:26 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 17:47:26 +0000 |
commit | 56f86276647eec079d270ffc83438f98d6aba441 (patch) | |
tree | e10c30d2c67b239cd520d7d55b57b2283dc41264 /tools/grit | |
parent | ccdce59f6234afccddab6b65577d7a4436bfd23c (diff) | |
download | chromium_src-56f86276647eec079d270ffc83438f98d6aba441.zip chromium_src-56f86276647eec079d270ffc83438f98d6aba441.tar.gz chromium_src-56f86276647eec079d270ffc83438f98d6aba441.tar.bz2 |
Only generate grit header id values for messages that are
used. This fixes a bug were we skip numbers in a header file.
Review URL: http://codereview.chromium.org/233004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r-- | tools/grit/grit/node/message.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py index 9410f93..8cdf0ef 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) |