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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 tools_dir = os.path.dirname(os.path.realpath(__file__)) | 595 tools_dir = os.path.dirname(os.path.realpath(__file__)) |
596 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') | 596 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') |
597 return os.path.join(dart_binary_prefix, 'dart') | 597 return os.path.join(dart_binary_prefix, 'dart') |
598 | 598 |
599 | 599 |
600 # The checked-in SDKs are documented at | 600 # The checked-in SDKs are documented at |
601 # https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools | 601 # https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools |
602 def CheckedInSdkPath(): | 602 def CheckedInSdkPath(): |
603 # We don't use the normal macos, linux, win32 directory names here, instead, | 603 # We don't use the normal macos, linux, win32 directory names here, instead, |
604 # we use the names that the download_from_google_storage script uses. | 604 # we use the names that the download_from_google_storage script uses. |
605 osdict = {'Darwin':'mac', 'Linux':'linux', 'Windows':'win'} | 605 osdict = {'Darwin':'mac', 'Linux':'linux', 'OpenBSD': 'openbsd', 'Windows':'wi
n'} |
606 system = platform.system() | 606 system = platform.system() |
607 try: | 607 try: |
608 osname = osdict[system] | 608 osname = osdict[system] |
609 except KeyError: | 609 except KeyError: |
610 print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system) | 610 print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system) |
611 return None; | 611 return None; |
612 tools_dir = os.path.dirname(os.path.realpath(__file__)) | 612 tools_dir = os.path.dirname(os.path.realpath(__file__)) |
613 return os.path.join(tools_dir, | 613 return os.path.join(tools_dir, |
614 'sdks', | 614 'sdks', |
615 osname, | 615 osname, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 os.chdir(self._working_directory) | 664 os.chdir(self._working_directory) |
665 | 665 |
666 def __exit__(self, *_): | 666 def __exit__(self, *_): |
667 print "Enter directory = ", self._old_cwd | 667 print "Enter directory = ", self._old_cwd |
668 os.chdir(self._old_cwd) | 668 os.chdir(self._old_cwd) |
669 | 669 |
670 | 670 |
671 if __name__ == "__main__": | 671 if __name__ == "__main__": |
672 import sys | 672 import sys |
673 Main() | 673 Main() |
OLD | NEW |