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

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

Issue 6992052: Revert 86551 (turns out testers run `gclient sync` as well, and there are 10.5 testers) (turns ou... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 elif node.name == 'include': 59 elif node.name == 'include':
60 # Only include files that we actually plan on using. 60 # Only include files that we actually plan on using.
61 if node.SatisfiesOutputCondition(): 61 if node.SatisfiesOutputCondition():
62 files.append(node.FilenameToOpen()) 62 files.append(node.FilenameToOpen())
63 # If it's a flattened node, grab inlined resources too. 63 # If it's a flattened node, grab inlined resources too.
64 if node.attrs['flattenhtml'] == 'true': 64 if node.attrs['flattenhtml'] == 'true':
65 files.extend(node.GetHtmlResourceFilenames()) 65 files.extend(node.GetHtmlResourceFilenames())
66 66
67 # Add in the grit source files. If one of these change, we want to re-run 67 # Add in the grit source files. If one of these change, we want to re-run
68 # grit. 68 # grit.
69 grit_root_dir = os.path.relpath(os.path.dirname(__file__), os.getcwd()) 69 grit_root_dir = os.path.dirname(__file__)
70 for root, dirs, filenames in os.walk(grit_root_dir): 70 for root, dirs, filenames in os.walk(grit_root_dir):
71 grit_src = [os.path.join(root, f) for f in filenames 71 grit_src = [os.path.join(root, f) for f in filenames
72 if f.endswith('.py') or f == 'resource_ids'] 72 if f.endswith('.py') or f == 'resource_ids']
73 files.extend(grit_src) 73 files.extend(grit_src)
74 74
75 return [f.replace('\\', '/') for f in files] 75 return [f.replace('\\', '/') for f in files]
76 76
77 77
78 def PrintUsage(): 78 def PrintUsage():
79 print 'USAGE: ./grit_info.py --inputs [-D foo] <grd-files>..' 79 print 'USAGE: ./grit_info.py --inputs [-D foo] <grd-files>..'
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 result = DoMain(argv[1:]) 122 result = DoMain(argv[1:])
123 if result == None: 123 if result == None:
124 PrintUsage() 124 PrintUsage()
125 return 1 125 return 1
126 print result 126 print result
127 return 0 127 return 0
128 128
129 129
130 if __name__ == '__main__': 130 if __name__ == '__main__':
131 sys.exit(main(sys.argv)) 131 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