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

Side by Side Diff: client/example/common.py

Issue 2093593002: luci-py: Making __file__ usage unicode safe. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Small fixes. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | client/libs/logdog/tests/bootstrap_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | client/libs/logdog/tests/bootstrap_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698