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

Side by Side Diff: bin/cros_gsdcurl.py

Issue 3005055: Dropping useless comment. Using getuser which is more correct. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Created 10 years, 4 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 | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 import getpass 7 import getpass
8 import os 8 import os
9 import re 9 import re
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 import tempfile 12 import tempfile
13 import urllib 13 import urllib
14 14
15 15
16 def Authenticate(): 16 def Authenticate():
17 # Authenticate. 17 default_username = getpass.getuser()
18 default_username = os.environ.get('LOGNAME', '')
19 username = os.environ.get('GSDCURL_USERNAME') 18 username = os.environ.get('GSDCURL_USERNAME')
20 if username is None: 19 if username is None:
21 sys.stderr.write('Username [' + default_username + ']: ') 20 sys.stderr.write('Username [' + default_username + ']: ')
22 username = raw_input() 21 username = raw_input()
23 if username == '': 22 if username == '':
24 username = default_username + '@google.com' 23 username = default_username + '@google.com'
25 elif '@' not in username: 24 elif '@' not in username:
26 username = username + '@google.com' 25 username = username + '@google.com'
27 passwd = os.environ.get('GSDCURL_PASSWORD') 26 passwd = os.environ.get('GSDCURL_PASSWORD')
28 if passwd is None: 27 if passwd is None:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 os.remove(cookies) 60 os.remove(cookies)
62 61
63 62
64 def main(argv): 63 def main(argv):
65 auth = Authenticate() 64 auth = Authenticate()
66 return DoCurl(auth, argv) 65 return DoCurl(auth, argv)
67 66
68 67
69 if __name__ == '__main__': 68 if __name__ == '__main__':
70 sys.exit(main(sys.argv)) 69 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698