summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/chromevox/tools/find_js_files.py
blob: 6d459a3149ce2772b8102b28c4161a0d93808ed2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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(
        _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()