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

Side by Side Diff: tools/utils.py

Issue 1519063004: - Prevent running of the dart_bootstrap script by default. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « tools/observatory_tool.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 # This file contains a set of utilities functions used by other Python-based 5 # This file contains a set of utilities functions used by other Python-based
6 # scripts. 6 # scripts.
7 7
8 import commands 8 import commands
9 import datetime 9 import datetime
10 import json 10 import json
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 elif arch == 'arm': 627 elif arch == 'arm':
628 name = 'dart-arm' 628 name = 'dart-arm'
629 return os.path.join(CheckedInSdkPath(), 'bin', name) 629 return os.path.join(CheckedInSdkPath(), 'bin', name)
630 630
631 631
632 def CheckedInSdkCheckExecutable(): 632 def CheckedInSdkCheckExecutable():
633 executable = CheckedInSdkExecutable() 633 executable = CheckedInSdkExecutable()
634 canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)), 634 canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),
635 'canary.dart') 635 'canary.dart')
636 try: 636 try:
637 if 42 == subprocess.call([executable, canary_script]): 637 with open(os.devnull, 'wb') as silent_sink:
638 return True 638 if 0 == subprocess.call([executable, canary_script], stdout=silent_sink):
639 return True
639 except OSError as e: 640 except OSError as e:
640 pass 641 pass
641 return False 642 return False
642 643
643 644
644 class TempDir(object): 645 class TempDir(object):
645 def __init__(self, prefix=''): 646 def __init__(self, prefix=''):
646 self._temp_dir = None 647 self._temp_dir = None
647 self._prefix = prefix 648 self._prefix = prefix
648 649
(...skipping 14 matching lines...) Expand all
663 os.chdir(self._working_directory) 664 os.chdir(self._working_directory)
664 665
665 def __exit__(self, *_): 666 def __exit__(self, *_):
666 print "Enter directory = ", self._old_cwd 667 print "Enter directory = ", self._old_cwd
667 os.chdir(self._old_cwd) 668 os.chdir(self._old_cwd)
668 669
669 670
670 if __name__ == "__main__": 671 if __name__ == "__main__":
671 import sys 672 import sys
672 Main() 673 Main()
OLDNEW
« no previous file with comments | « tools/observatory_tool.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698