OLD | NEW |
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 '''Uses the closure compiler to check the ChromeVox javascript files. | 7 '''Uses the closure compiler to check the ChromeVox javascript files. |
8 | 8 |
9 With no arguments, checks all ChromeVox scripts. If any arguments are | 9 With no arguments, checks all ChromeVox scripts. If any arguments are |
10 specified, only scripts that include any of the specified files will be | 10 specified, only scripts that include any of the specified files will be |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 _CHROME_EXTENSIONS_EXTERNS] | 55 _CHROME_EXTENSIONS_EXTERNS] |
56 | 56 |
57 # List of top-level scripts and externs that we can check. | 57 # List of top-level scripts and externs that we can check. |
58 _TOP_LEVEL_SCRIPTS = [ | 58 _TOP_LEVEL_SCRIPTS = [ |
59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], | 59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], |
60 [_CHROME_EXTENSIONS_EXTERNS]], | 60 [_CHROME_EXTENSIONS_EXTERNS]], |
61 [[CVoxPath('chromevox/background/loader.js')], _COMMON_EXTERNS], | 61 [[CVoxPath('chromevox/background/loader.js')], _COMMON_EXTERNS], |
62 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], | 62 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], |
63 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], | 63 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], |
64 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], | 64 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], |
| 65 [[CVoxPath('cvox2/background/panel_loader.js')], _COMMON_EXTERNS], |
65 ] | 66 ] |
66 | 67 |
67 | 68 |
68 def _Compile(js_files, externs): | 69 def _Compile(js_files, externs): |
69 try: | 70 try: |
70 return RunCompiler(js_files, externs) | 71 return RunCompiler(js_files, externs) |
71 except KeyboardInterrupt: | 72 except KeyboardInterrupt: |
72 return (False, 'KeyboardInterrupt') | 73 return (False, 'KeyboardInterrupt') |
73 | 74 |
74 | 75 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if len(args) > 0: | 133 if len(args) > 0: |
133 changed_paths = (os.path.relpath(p) for p in args) | 134 changed_paths = (os.path.relpath(p) for p in args) |
134 success, output = CheckChromeVox(changed_paths) | 135 success, output = CheckChromeVox(changed_paths) |
135 if len(output) > 0: | 136 if len(output) > 0: |
136 print output | 137 print output |
137 return int(not success) | 138 return int(not success) |
138 | 139 |
139 | 140 |
140 if __name__ == '__main__': | 141 if __name__ == '__main__': |
141 sys.exit(main()) | 142 sys.exit(main()) |
OLD | NEW |