OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
nednguyen
2016/09/23 10:17:49
We can now remove this & change the catapult_build
charliea (OOO until 10-5)
2016/09/23 13:06:35
Good idea. Done.
| |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 _NODE_RUNNER_PATH = os.path.abspath( | |
10 os.path.join(os.path.dirname(__file__), '..')) | |
11 | 9 |
12 | 10 _ESLINT_PATH = os.path.abspath( |
13 _PY_UTILS_PATH = os.path.abspath( | 11 os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, |
charliea (OOO until 10-5)
2016/09/23 03:18:23
(I think that this was unused)
| |
14 os.path.join(_NODE_RUNNER_PATH, '..', 'py_utils')) | 12 os.path.pardir, 'common', 'eslint')) |
15 | 13 |
16 | 14 |
17 def _AddToPathIfNeeded(path): | 15 def _AddToPathIfNeeded(path): |
18 if path not in sys.path: | 16 if path not in sys.path: |
19 sys.path.insert(0, path) | 17 sys.path.insert(0, path) |
20 | 18 |
21 | 19 |
22 if __name__ == '__main__': | 20 if __name__ == '__main__': |
23 _AddToPathIfNeeded(_NODE_RUNNER_PATH) | 21 _AddToPathIfNeeded(_ESLINT_PATH) |
24 _AddToPathIfNeeded(_PY_UTILS_PATH) | |
25 | 22 |
26 from node_runner import node_util | 23 from eslint import eslint |
27 print node_util.RunEslint() | 24 print eslint.RunEslint() |
28 sys.exit(0) | 25 sys.exit(0) |
OLD | NEW |