| OLD | NEW |
| (Empty) |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 import os | |
| 5 import sys | |
| 6 | |
| 7 | |
| 8 def GetCatapultDir(): | |
| 9 return os.path.normpath(os.path.join( | |
| 10 os.path.dirname(__file__), '..', '..', '..', 'third_party', 'catapult')) | |
| 11 | |
| 12 | |
| 13 def IsRunningOnCrosDevice(): | |
| 14 """Returns True if we're on a ChromeOS device.""" | |
| 15 lsb_release = '/etc/lsb-release' | |
| 16 if sys.platform.startswith('linux') and os.path.exists(lsb_release): | |
| 17 with open(lsb_release, 'r') as f: | |
| 18 res = f.read() | |
| 19 if res.count('CHROMEOS_RELEASE_NAME'): | |
| 20 return True | |
| 21 return False | |
| 22 | |
| 23 | |
| 24 def IsExecutable(path): | |
| 25 return os.path.isfile(path) and os.access(path, os.X_OK) | |
| OLD | NEW |