OLD | NEW |
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 name = 'dart' | 628 name = 'dart' |
629 if IsWindows(): | 629 if IsWindows(): |
630 name = 'dart.exe' | 630 name = 'dart.exe' |
631 elif GuessOS() == 'linux': | 631 elif GuessOS() == 'linux': |
632 arch = GuessArchitecture() | 632 arch = GuessArchitecture() |
633 if arch == 'mips': | 633 if arch == 'mips': |
634 name = 'dart-mips' | 634 name = 'dart-mips' |
635 elif arch == 'arm': | 635 elif arch == 'arm': |
636 name = 'dart-arm' | 636 name = 'dart-arm' |
637 elif arch == 'arm64': | 637 elif arch == 'arm64': |
638 name = 'dart-arm' | 638 name = 'dart-arm64' |
639 return os.path.join(CheckedInSdkPath(), 'bin', name) | 639 return os.path.join(CheckedInSdkPath(), 'bin', name) |
640 | 640 |
641 | 641 |
642 def CheckedInSdkCheckExecutable(): | 642 def CheckedInSdkCheckExecutable(): |
643 executable = CheckedInSdkExecutable() | 643 executable = CheckedInSdkExecutable() |
644 canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)), | 644 canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)), |
645 'canary.dart') | 645 'canary.dart') |
646 try: | 646 try: |
647 with open(os.devnull, 'wb') as silent_sink: | 647 with open(os.devnull, 'wb') as silent_sink: |
648 if 0 == subprocess.call([executable, canary_script], stdout=silent_sink): | 648 if 0 == subprocess.call([executable, canary_script], stdout=silent_sink): |
(...skipping 25 matching lines...) Expand all Loading... |
674 os.chdir(self._working_directory) | 674 os.chdir(self._working_directory) |
675 | 675 |
676 def __exit__(self, *_): | 676 def __exit__(self, *_): |
677 print "Enter directory = ", self._old_cwd | 677 print "Enter directory = ", self._old_cwd |
678 os.chdir(self._old_cwd) | 678 os.chdir(self._old_cwd) |
679 | 679 |
680 | 680 |
681 if __name__ == "__main__": | 681 if __name__ == "__main__": |
682 import sys | 682 import sys |
683 Main() | 683 Main() |
OLD | NEW |