Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/tools/find_js_files.py |
| diff --git a/chrome/browser/resources/chromeos/chromevox/tools/find_js_files.py b/chrome/browser/resources/chromeos/chromevox/tools/find_js_files.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..63069a4a07026d378e649876d1fd3a6211ba5314 |
| --- /dev/null |
| +++ b/chrome/browser/resources/chromeos/chromevox/tools/find_js_files.py |
| @@ -0,0 +1,33 @@ |
| +#!/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. |
| + |
| +'''Scans one or more directory trees for .js files, printing filenames, |
| +relative to the current directory on stdout. |
| +''' |
| + |
| +import optparse |
| +import os |
| +import sys |
| + |
| +_SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__)) |
| +_CHROME_SOURCE = os.path.realpath( |
| + os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 6)) |
| +sys.path.insert(0, os.path.join( |
|
dmazzoni
2014/05/30 17:03:42
nit: indent
|
| + _CHROME_SOURCE, ('chrome/third_party/chromevox/third_party/' + |
| + 'closure-library/closure/bin/build'))) |
| +import treescan |
| + |
| + |
| +def main(): |
| + parser = optparse.OptionParser(description=__doc__) |
| + parser.usage = '%prog <tree_root>...' |
| + _, args = parser.parse_args() |
| + for root in args: |
| + print '\n'.join(treescan.ScanTreeForJsFiles(root)) |
| + |
| + |
| +if __name__ == '__main__': |
| + main() |