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

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

Issue 1620023002: Revert of Remove catapult_base from telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perf_cb_move
Patch Set: Created 4 years, 11 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/catapult_base/test_data/foo.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/catapult_base/util.py
diff --git a/tools/telemetry/catapult_base/util.py b/tools/telemetry/catapult_base/util.py
new file mode 100644
index 0000000000000000000000000000000000000000..25fed017f7a10f56e1805272088091c49d25b332
--- /dev/null
+++ b/tools/telemetry/catapult_base/util.py
@@ -0,0 +1,25 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+import sys
+
+
+def GetCatapultDir():
+ return os.path.normpath(os.path.join(
+ os.path.dirname(__file__), '..', '..', '..', 'third_party', 'catapult'))
+
+
+def IsRunningOnCrosDevice():
+ """Returns True if we're on a ChromeOS device."""
+ lsb_release = '/etc/lsb-release'
+ if sys.platform.startswith('linux') and os.path.exists(lsb_release):
+ with open(lsb_release, 'r') as f:
+ res = f.read()
+ if res.count('CHROMEOS_RELEASE_NAME'):
+ return True
+ return False
+
+
+def IsExecutable(path):
+ return os.path.isfile(path) and os.access(path, os.X_OK)
« no previous file with comments | « tools/telemetry/catapult_base/test_data/foo.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698