Chromium Code Reviews| Index: build/android/gyp/find.py |
| diff --git a/build/android/gyp/find.py b/build/android/gyp/find.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..85cfd153170e9c1e3be2b56b94369bd16290ade3 |
| --- /dev/null |
| +++ b/build/android/gyp/find.py |
| @@ -0,0 +1,26 @@ |
| +#!/usr/bin/env python |
| +# |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Finds files in directories. |
| +""" |
| + |
| +import fnmatch |
| +import optparse |
| +import os |
| +import sys |
| + |
|
newt (away)
2014/07/07 21:47:11
two newlines
cjhopman
2014/07/08 00:16:26
Done.
|
| +def main(argv): |
| + parser = optparse.OptionParser() |
| + parser.add_option('--pattern', default='*', help='File pattern to match.') |
| + options, directories = parser.parse_args(argv) |
| + |
| + for d in directories: |
| + for root, _, filenames in os.walk(d): |
| + for f in fnmatch.filter(filenames, options.pattern): |
| + print os.path.join(root, f) |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv[1:])) |