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

Side by Side Diff: build/android/gyp/find.py

Issue 586383002: Add ChromeShellTestApk and other chrome/ test stuff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-chrome-shell-apk
Patch Set: Rebase Created 6 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | build/config/android/rules.gni » ('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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Finds files in directories. 7 """Finds files in directories.
8 """ 8 """
9 9
10 import fnmatch 10 import fnmatch
11 import optparse 11 import optparse
12 import os 12 import os
13 import sys 13 import sys
14 14
15 15
16 def main(argv): 16 def main(argv):
17 parser = optparse.OptionParser() 17 parser = optparse.OptionParser()
18 parser.add_option('--pattern', default='*', help='File pattern to match.') 18 parser.add_option('--pattern', default='*', help='File pattern to match.')
19 options, directories = parser.parse_args(argv) 19 options, directories = parser.parse_args(argv)
20 20
21 for d in directories: 21 for d in directories:
22 if not os.path.exists(d):
23 print >> sys.stderr, '%s does not exist' % d
24 return 1
22 for root, _, filenames in os.walk(d): 25 for root, _, filenames in os.walk(d):
23 for f in fnmatch.filter(filenames, options.pattern): 26 for f in fnmatch.filter(filenames, options.pattern):
24 print os.path.join(root, f) 27 print os.path.join(root, f)
25 28
26 if __name__ == '__main__': 29 if __name__ == '__main__':
27 sys.exit(main(sys.argv[1:])) 30 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698