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

Unified Diff: tools/observatory_tool.py

Issue 1342493003: Move CheckedInSdkPath helpers to utils (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | tools/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/observatory_tool.py
diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py
index 776dbfffa6b481e855b1639f6d705914d924a95c..adf103fde62b31c32ee4ab930f40256ae9c9de62 100755
--- a/tools/observatory_tool.py
+++ b/tools/observatory_tool.py
@@ -10,6 +10,7 @@ import platform
import shutil
import subprocess
import sys
+import utils
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
@@ -27,25 +28,6 @@ IGNORE_PATTERNS = shutil.ignore_patterns(
usage = """obs_tool.py [options]"""
-def GetDartSdkPubExecutablePath():
- osdict = {'Darwin':'mac', 'Linux':'linux', 'Windows':'win'}
- system = platform.system()
- executable_name = 'pub'
- if system == 'Windows':
- executable_name = 'pub.bat'
- try:
- osname = osdict[system]
- except KeyError:
- print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system)
- return None;
- return os.path.join(DART_ROOT,
- 'tools',
- 'sdks',
- osname,
- 'dart-sdk',
- 'bin',
- executable_name)
-
def BuildArguments():
result = argparse.ArgumentParser(usage=usage)
result.add_argument("--package-root", help="package root", default=None)
@@ -66,7 +48,7 @@ def ProcessOptions(options, args):
return True
if (options.sdk != None):
# Use the checked in pub executable by default.
- options.pub_executable = GetDartSdkPubExecutablePath()
+ options.pub_executable = utils.CheckedInPubPath()
return True
# Otherwise, we need a dart executable and a package root.
return ((options.package_root != None) and
« no previous file with comments | « no previous file | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698