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

Side by Side Diff: tools/grit/grit/grd_reader.py

Issue 6685061: Compile the devtools grd file into a .pak file so we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and fix win Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome.gyp ('k') | tools/grit/grit/grd_reader_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/python2.4
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''Class for reading GRD files into memory, without processing them. 6 '''Class for reading GRD files into memory, without processing them.
7 ''' 7 '''
8 8
9 import os.path 9 import os.path
10 import types 10 import types
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 assert isinstance(filename_or_stream, types.StringType) or dir != None 140 assert isinstance(filename_or_stream, types.StringType) or dir != None
141 if not dir: 141 if not dir:
142 dir = util.dirname(filename_or_stream) 142 dir = util.dirname(filename_or_stream)
143 if len(dir) == 0: 143 if len(dir) == 0:
144 dir = '.' 144 dir = '.'
145 # Fix up the base_dir so it is relative to the input file. 145 # Fix up the base_dir so it is relative to the input file.
146 handler.root.SetOwnDir(dir) 146 handler.root.SetOwnDir(dir)
147 147
148 # Assign first ids to the nodes that don't have them. 148 # Assign first ids to the nodes that don't have them.
149 if isinstance(handler.root, misc.GritNode) and first_id_filename != '': 149 if isinstance(handler.root, misc.GritNode) and first_id_filename != '':
150 handler.root.AssignFirstIds(filename_or_stream, first_id_filename) 150 handler.root.AssignFirstIds(filename_or_stream, first_id_filename, defines)
151 151
152 return handler.root 152 return handler.root
153 153
154 154
155 if __name__ == '__main__': 155 if __name__ == '__main__':
156 util.ChangeStdoutEncoding() 156 util.ChangeStdoutEncoding()
157 print unicode(Parse(sys.argv[1])) 157 print unicode(Parse(sys.argv[1]))
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | tools/grit/grit/grd_reader_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698