Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / braille_ime / check_braille_ime.py
bloba25cd199e0d8fcc3d0970dddebab12e76289bced
1 #!/usr/bin/env python
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
5 # found in the LICENSE file.
7 '''Uses the closure compiler to check the braille ime.'''
9 import os
10 import sys
13 _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
15 sys.path.insert(0, os.path.join(_SCRIPT_DIR, '..', 'chromevox', 'tools'))
16 from jscompilerwrapper import RunCompiler
19 _CHROME_SOURCE_DIR = os.path.normpath(
20 os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 5))
23 def CheckBrailleIme():
24 print 'Compiling braille IME.'
25 js_files = [
26 os.path.join(_SCRIPT_DIR, 'braille_ime.js'),
27 os.path.join(_SCRIPT_DIR, 'main.js')]
28 externs = [
29 os.path.join(
30 _CHROME_SOURCE_DIR,
31 'third_party/closure_compiler/externs/chrome_extensions.js'),
32 os.path.join(_SCRIPT_DIR, 'externs.js')]
33 return RunCompiler(js_files, externs)
36 def main():
37 success, output = CheckBrailleIme()
38 if len(output) > 0:
39 print output
40 return int(not success)
43 if __name__ == '__main__':
44 sys.exit(main())