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

Unified Diff: tools/grit/grit/format/rc.py

Issue 2429213007: grit: Reorganize and compact resource_ids. (Closed)
Patch Set: rebase to r427103 Created 4 years, 2 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 | tools/gritsettings/resource_ids » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/rc.py
diff --git a/tools/grit/grit/format/rc.py b/tools/grit/grit/format/rc.py
index eb8efaca1d9f9217450841ef24ae9245957c4734..4331a5806a42425075d0c260e3a9615db91a8d30 100755
--- a/tools/grit/grit/format/rc.py
+++ b/tools/grit/grit/format/rc.py
@@ -12,6 +12,7 @@ import re
from functools import partial
from grit import util
+from grit.format import rc_header
from grit.node import misc
@@ -448,8 +449,10 @@ def FormatInclude(item, lang, output_dir, type=None, process_html=False):
if isinstance(item, structure.StructureNode) and item.IsExcludedFromRc():
return ''
- else:
- return '%-18s %-18s "%s"\n' % (item.attrs['name'], type, filename)
+
+ name = item.attrs['name']
+ item_id = rc_header.GetIds(item.GetRoot())[name]
+ return '// ID: %d\n%-18s %-18s "%s"\n' % (item_id, name, type, filename)
def _DoNotFormat(item, lang, output_dir):
« no previous file with comments | « no previous file | tools/gritsettings/resource_ids » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698