Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
|
Dirk Pranke
2016/12/07 03:35:11
There's a lot of overlap between this file and web
| |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 """Tiny utility to find various paths, relevant for running tests. | |
| 5 """ | |
| 6 | |
| 7 import os | |
| 8 import sys | |
| 9 | |
| 10 | |
| 11 def find_typ_dir(): | |
|
Yuki
2016/12/06 07:59:42
nit: "find_typ_dir" reads to me that this function
Dirk Pranke
2016/12/07 03:35:11
Agreed.
| |
| 12 path_to_typ = get_typ_dir() | |
| 13 if path_to_typ not in sys.path: | |
| 14 sys.path.append(path_to_typ) | |
| 15 | |
| 16 | |
| 17 def find_bindings_scripts_dir(): | |
|
Yuki
2016/12/06 07:59:42
ditto
| |
| 18 path_to_bindings_scripts = get_bindings_scripts_dir() | |
| 19 if path_to_bindings_scripts not in sys.path: | |
| 20 sys.path.append(path_to_bindings_scripts) | |
| 21 | |
| 22 | |
| 23 def get_bindings_scripts_dir(): | |
| 24 return os.path.join(get_source_dir(), 'bindings', 'scripts') | |
| 25 | |
| 26 | |
| 27 def get_blink_dir(): | |
| 28 return os.path.dirname(os.path.dirname(get_scripts_dir())) | |
| 29 | |
| 30 | |
| 31 def get_chromium_src_dir(): | |
| 32 return os.path.dirname(os.path.dirname(get_blink_dir())) | |
| 33 | |
| 34 | |
| 35 def get_scripts_dir(): | |
| 36 return os.path.dirname(os.path.dirname(os.path.realpath(__file__))) | |
| 37 | |
| 38 | |
| 39 def get_source_dir(): | |
| 40 return os.path.join(get_blink_dir(), 'Source') | |
| 41 | |
| 42 | |
| 43 def get_typ_dir(): | |
| 44 return os.path.join(get_chromium_src_dir(), 'third_party', 'typ') | |
| 45 | |
| 46 | |
| 47 def get_webkitpy_thirdparty_dir(): | |
| 48 return os.path.join(get_scripts_dir(), 'webkitpy', 'thirdparty') | |
| OLD | NEW |