Index: third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py b/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a64cefea20f75c42aaf9697e50ffb03d4c37b424 |
--- /dev/null |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py |
@@ -0,0 +1,48 @@ |
+# 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
|
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+"""Tiny utility to find various paths, relevant for running tests. |
+""" |
+ |
+import os |
+import sys |
+ |
+ |
+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.
|
+ path_to_typ = get_typ_dir() |
+ if path_to_typ not in sys.path: |
+ sys.path.append(path_to_typ) |
+ |
+ |
+def find_bindings_scripts_dir(): |
Yuki
2016/12/06 07:59:42
ditto
|
+ path_to_bindings_scripts = get_bindings_scripts_dir() |
+ if path_to_bindings_scripts not in sys.path: |
+ sys.path.append(path_to_bindings_scripts) |
+ |
+ |
+def get_bindings_scripts_dir(): |
+ return os.path.join(get_source_dir(), 'bindings', 'scripts') |
+ |
+ |
+def get_blink_dir(): |
+ return os.path.dirname(os.path.dirname(get_scripts_dir())) |
+ |
+ |
+def get_chromium_src_dir(): |
+ return os.path.dirname(os.path.dirname(get_blink_dir())) |
+ |
+ |
+def get_scripts_dir(): |
+ return os.path.dirname(os.path.dirname(os.path.realpath(__file__))) |
+ |
+ |
+def get_source_dir(): |
+ return os.path.join(get_blink_dir(), 'Source') |
+ |
+ |
+def get_typ_dir(): |
+ return os.path.join(get_chromium_src_dir(), 'third_party', 'typ') |
+ |
+ |
+def get_webkitpy_thirdparty_dir(): |
+ return os.path.join(get_scripts_dir(), 'webkitpy', 'thirdparty') |