Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: tools/telemetry/telemetry/util/path.py

Issue 1033053002: [telemetry] Refactoring script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fixup Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/util/find_dependencies.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/util/path.py
diff --git a/tools/telemetry/telemetry/util/path.py b/tools/telemetry/telemetry/util/path.py
index 7feb861bdfba2c627cae5c062d998c5da32f7d29..c9018139424f3ab3f3eb03f63c3d3ba3d04811db 100644
--- a/tools/telemetry/telemetry/util/path.py
+++ b/tools/telemetry/telemetry/util/path.py
@@ -41,3 +41,15 @@ def FindInstalledWindowsApplication(application_path):
return path
return None
+
+
+def IsSubpath(subpath, superpath):
+ """Returns True iff subpath is or is in superpath."""
+ subpath = os.path.realpath(subpath)
+ superpath = os.path.realpath(superpath)
+
+ while len(subpath) >= len(superpath):
+ if subpath == superpath:
+ return True
+ subpath = os.path.split(subpath)[0]
+ return False
« no previous file with comments | « tools/telemetry/telemetry/util/find_dependencies.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698