1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 from os.path import join
11 def FindFiles(top, pattern, **kwargs):
12 """Finds files under |top| matching the glob pattern |pattern|, returning a
15 for dirpath, _, filenames in walk(top, **kwargs):
16 for filename in fnmatch.filter(filenames, pattern):
17 matches.append(join(dirpath, filename))
23 print "usage: %s path pattern" % argv[0]
26 for filename in FindFiles(argv[1], argv[2]):
31 if __name__ == '__main__':
32 sys.exit(main(sys.argv))