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

Side by Side Diff: grit_info.py

Issue 11968053: Sort GritSourceFiles() output. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | 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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 '''Tool to determine inputs and outputs of a grit file. 6 '''Tool to determine inputs and outputs of a grit file.
7 ''' 7 '''
8 8
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return [t.replace('\\', '/') for t in target] 52 return [t.replace('\\', '/') for t in target]
53 53
54 54
55 def GritSourceFiles(): 55 def GritSourceFiles():
56 files = [] 56 files = []
57 grit_root_dir = os.path.relpath(os.path.dirname(__file__), os.getcwd()) 57 grit_root_dir = os.path.relpath(os.path.dirname(__file__), os.getcwd())
58 for root, dirs, filenames in os.walk(grit_root_dir): 58 for root, dirs, filenames in os.walk(grit_root_dir):
59 grit_src = [os.path.join(root, f) for f in filenames 59 grit_src = [os.path.join(root, f) for f in filenames
60 if f.endswith('.py')] 60 if f.endswith('.py')]
61 files.extend(grit_src) 61 files.extend(grit_src)
62 return files 62 return sorted(files)
63 63
64 64
65 def Inputs(filename, defines, ids_file): 65 def Inputs(filename, defines, ids_file):
66 grd = grd_reader.Parse( 66 grd = grd_reader.Parse(
67 filename, debug=False, defines=defines, tags_to_ignore=set(['message']), 67 filename, debug=False, defines=defines, tags_to_ignore=set(['message']),
68 first_ids_file=ids_file) 68 first_ids_file=ids_file)
69 files = set() 69 files = set()
70 for lang, ctx in grd.GetConfigurations(): 70 for lang, ctx in grd.GetConfigurations():
71 grd.SetOutputLanguage(lang or grd.GetSourceLanguage()) 71 grd.SetOutputLanguage(lang or grd.GetSourceLanguage())
72 grd.SetOutputContext(ctx) 72 grd.SetOutputContext(ctx)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 except WrongNumberOfArguments, e: 169 except WrongNumberOfArguments, e:
170 PrintUsage() 170 PrintUsage()
171 print e 171 print e
172 return 1 172 return 1
173 print result 173 print result
174 return 0 174 return 0
175 175
176 176
177 if __name__ == '__main__': 177 if __name__ == '__main__':
178 sys.exit(main(sys.argv)) 178 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698