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

Unified Diff: tools/grit/grit/grd_reader.py

Issue 2690263004: Add option to GRIT to provide a resource ordering input file. (Closed)
Patch Set: Reverse dict using 1-liner-ish. Created 3 years, 10 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 | « tools/grit/grit/format/rc_header_unittest.py ('k') | tools/grit/grit/tool/build.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/grd_reader.py
diff --git a/tools/grit/grit/grd_reader.py b/tools/grit/grit/grd_reader.py
index 87eec5e622ce89ef77643ba3fb0db127e03cc00d..ba8ad49feed2de62fc18659f1a3e3a6b8a424a74 100755
--- a/tools/grit/grit/grd_reader.py
+++ b/tools/grit/grit/grd_reader.py
@@ -13,6 +13,7 @@ import xml.sax.handler
from grit import exception
from grit import util
+from grit.format import rc_header
from grit.node import base
from grit.node import mapping
from grit.node import misc
@@ -139,7 +140,8 @@ class GrdPartContentHandler(xml.sax.handler.ContentHandler):
def Parse(filename_or_stream, dir=None, stop_after=None, first_ids_file=None,
- debug=False, defines=None, tags_to_ignore=None, target_platform=None):
+ debug=False, defines=None, tags_to_ignore=None, target_platform=None,
+ predetermined_ids_file=None):
'''Parses a GRD file into a tree of nodes (from grit.node).
If filename_or_stream is a stream, 'dir' should point to the directory
@@ -168,6 +170,9 @@ def Parse(filename_or_stream, dir=None, stop_after=None, first_ids_file=None,
defines: dictionary of defines, like {'chromeos': '1'}
target_platform: None or the value that would be returned by sys.platform
on your target platform.
+ predetermined_ids_file: File path to a file containing a pre-determined
+ mapping from resource names to resource ids which will be used to assign
+ resource ids to those resources.
Return:
Subclass of grit.node.base.Node
@@ -179,6 +184,7 @@ def Parse(filename_or_stream, dir=None, stop_after=None, first_ids_file=None,
if dir is None and isinstance(filename_or_stream, types.StringType):
dir = util.dirname(filename_or_stream)
+ rc_header.SetPredeterminedIdsFile(predetermined_ids_file)
handler = GrdContentHandler(stop_after=stop_after, debug=debug, dir=dir,
defines=defines, tags_to_ignore=tags_to_ignore,
target_platform=target_platform)
« no previous file with comments | « tools/grit/grit/format/rc_header_unittest.py ('k') | tools/grit/grit/tool/build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698