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

Unified Diff: tools/create_sdk.py

Issue 350483003: Build Tools Cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more fixes as reviewed by ricow Created 6 years, 6 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/create_editor.py ('k') | tools/create_tarball.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/create_sdk.py
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 4ac8679dfc8428f5fef2f02bbce2d9f86b106a4b..a5340387c0c3009751cfdd6d112e1af6343321c9 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
@@ -48,19 +48,19 @@
# ......(more will come here)
-import glob
import optparse
import os
import re
import sys
import subprocess
-import tempfile
+
import utils
+
HOST_OS = utils.GuessOS()
# TODO(dgrove): Only import modules following Google style guide.
-from os.path import basename, dirname, join, realpath, exists, isdir
+from os.path import basename, dirname, join, realpath, exists
# TODO(dgrove): Only import modules following Google style guide.
from shutil import copyfile, copymode, copytree, ignore_patterns, rmtree, move
@@ -76,8 +76,8 @@ def GetOptions():
def ReplaceInFiles(paths, subs):
- '''Reads a series of files, applies a series of substitutions to each, and
- saves them back out. subs should by a list of (pattern, replace) tuples.'''
+ """Reads a series of files, applies a series of substitutions to each, and
+ saves them back out. subs should by a list of (pattern, replace) tuples."""
for path in paths:
contents = open(path).read()
for pattern, replace in subs:
@@ -94,8 +94,8 @@ def Copy(src, dest):
def CopyShellScript(src_file, dest_dir):
- '''Copies a shell/batch script to the given destination directory. Handles
- using the appropriate platform-specific file extension.'''
+ """Copies a shell/batch script to the given destination directory. Handles
+ using the appropriate platform-specific file extension."""
file_extension = ''
if HOST_OS == 'win32':
file_extension = '.bat'
@@ -119,7 +119,7 @@ def CopySnapshots(snapshots, sdk_root):
join(sdk_root, 'bin', 'snapshots', snapshot))
-def Main(argv):
+def Main():
# Pull in all of the gypi files which will be munged into the sdk.
HOME = dirname(dirname(realpath(__file__)))
@@ -255,4 +255,4 @@ def Main(argv):
move(SDK_tmp, SDK)
if __name__ == '__main__':
- sys.exit(Main(sys.argv))
+ sys.exit(Main())
« no previous file with comments | « tools/create_editor.py ('k') | tools/create_tarball.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698