| OLD | NEW |
| 1 # Copyright 2012 The LUCI Authors. All rights reserved. | 1 # Copyright 2012 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import datetime | 5 import datetime |
| 6 import getpass | 6 import getpass |
| 7 import hashlib | 7 import hashlib |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 | 13 |
| 14 ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) | 14 ROOT_DIR = os.path.dirname(os.path.abspath( |
| 15 __file__.decode(sys.getfilesystemencoding()))) |
| 15 sys.path.append(os.path.join(ROOT_DIR, '..', 'third_party')) | 16 sys.path.append(os.path.join(ROOT_DIR, '..', 'third_party')) |
| 16 | 17 |
| 17 import colorama | 18 import colorama |
| 18 | 19 |
| 19 | 20 |
| 20 CHROMIUM_SWARMING_OSES = { | 21 CHROMIUM_SWARMING_OSES = { |
| 21 'darwin': 'Mac', | 22 'darwin': 'Mac', |
| 22 'cygwin': 'Windows', | 23 'cygwin': 'Windows', |
| 23 'linux2': 'Ubuntu', | 24 'linux2': 'Ubuntu', |
| 24 'win32': 'Windows', | 25 'win32': 'Windows', |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 'isolate.py', | 117 'isolate.py', |
| 117 'archive', | 118 'archive', |
| 118 '--isolate', os.path.join('payload', 'hello_world.isolate'), | 119 '--isolate', os.path.join('payload', 'hello_world.isolate'), |
| 119 '--isolated', isolated, | 120 '--isolated', isolated, |
| 120 '--isolate-server', isolate_server, | 121 '--isolate-server', isolate_server, |
| 121 '--config-variable', 'OS', swarming_os, | 122 '--config-variable', 'OS', swarming_os, |
| 122 ], verbose) | 123 ], verbose) |
| 123 with open(isolated, 'rb') as f: | 124 with open(isolated, 'rb') as f: |
| 124 hashval = hashlib.sha1(f.read()).hexdigest() | 125 hashval = hashlib.sha1(f.read()).hexdigest() |
| 125 return isolated, hashval | 126 return isolated, hashval |
| OLD | NEW |