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

Unified Diff: grit/format/resource_map.py

Issue 443183003: Respect output_all_resource_defines when generating structures in resource (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 4 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 | grit/format/resource_map_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/resource_map.py
===================================================================
--- grit/format/resource_map.py (revision 171)
+++ grit/format/resource_map.py (working copy)
@@ -109,18 +109,18 @@
tids = rc_header.GetIds(root)
seen = set()
active_descendants = [item for item in root.ActiveDescendants()]
+ output_all_resource_defines = root.ShouldOutputAllResourceDefines()
for item in root:
- if isinstance(item, (include.IncludeNode,
- structure.StructureNode,
- message.MessageNode)):
- key = get_key(item)
- tid = item.attrs['name']
- if tid in tids and key not in seen:
- seen.add(key)
- # For messages, only include the active ones
- if not isinstance(item, message.MessageNode) \
- or item in active_descendants:
- yield ' {"%s", %s},\n' % (key, tid)
+ if not item.IsResourceMapSource():
+ continue
+ key = get_key(item)
+ tid = item.attrs['name']
+ if tid not in tids or key in seen:
+ continue
+ seen.add(key)
+ if item.GeneratesResourceMapEntry(output_all_resource_defines,
+ item in active_descendants):
+ yield ' {"%s", %s},\n' % (key, tid)
yield _FormatSourceFooter(root)
« no previous file with comments | « no previous file | grit/format/resource_map_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698