| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 CVoxPath('liblouis_nacl/externs.js'), | 43 CVoxPath('liblouis_nacl/externs.js'), |
| 44 CVoxPath('host/chrome/externs.js')] | 44 CVoxPath('host/chrome/externs.js')] |
| 45 | 45 |
| 46 # List of top-level scripts and externs that we can check. | 46 # List of top-level scripts and externs that we can check. |
| 47 _TOP_LEVEL_SCRIPTS = [ | 47 _TOP_LEVEL_SCRIPTS = [ |
| 48 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], | 48 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], |
| 49 [CVoxPath('common/chrome_extension_externs.js')]], | 49 [CVoxPath('common/chrome_extension_externs.js')]], |
| 50 [[CVoxPath('chromevox/background/loader.js')], _COMMON_EXTERNS], | 50 [[CVoxPath('chromevox/background/loader.js')], _COMMON_EXTERNS], |
| 51 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], | 51 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], |
| 52 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], | 52 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], |
| 53 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], |
| 53 ] | 54 ] |
| 54 | 55 |
| 55 | 56 |
| 56 def _Compile(js_files, externs): | 57 def _Compile(js_files, externs): |
| 57 try: | 58 try: |
| 58 return RunCompiler(js_files, externs) | 59 return RunCompiler(js_files, externs) |
| 59 except KeyboardInterrupt: | 60 except KeyboardInterrupt: |
| 60 return (False, 'KeyboardInterrupt') | 61 return (False, 'KeyboardInterrupt') |
| 61 | 62 |
| 62 | 63 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if len(args) > 0: | 121 if len(args) > 0: |
| 121 changed_paths = (os.path.relpath(p) for p in args) | 122 changed_paths = (os.path.relpath(p) for p in args) |
| 122 success, output = CheckChromeVox(changed_paths) | 123 success, output = CheckChromeVox(changed_paths) |
| 123 if len(output) > 0: | 124 if len(output) > 0: |
| 124 print output | 125 print output |
| 125 return int(not success) | 126 return int(not success) |
| 126 | 127 |
| 127 | 128 |
| 128 if __name__ == '__main__': | 129 if __name__ == '__main__': |
| 129 sys.exit(main()) | 130 sys.exit(main()) |
| OLD | NEW |