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

Side by Side Diff: depot-tools-auth.py

Issue 1847783002: Multiple improvements to windows bash integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Add direct mode and unbuffered Created 4 years, 8 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 | « bootstrap/win/win_tools.bat ('k') | gclient.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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium 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 """Manages cached OAuth2 tokens used by other depot_tools scripts. 6 """Manages cached OAuth2 tokens used by other depot_tools scripts.
7 7
8 Usage: 8 Usage:
9 depot-tools-auth login codereview.chromium.org 9 depot-tools-auth login codereview.chromium.org
10 depot-tools-auth info codereview.chromium.org 10 depot-tools-auth info codereview.chromium.org
11 depot-tools-auth logout codereview.chromium.org 11 depot-tools-auth logout codereview.chromium.org
12 """ 12 """
13 13
14 import logging 14 import logging
15 import optparse 15 import optparse
16 import sys 16 import sys
17 import os
17 18
18 from third_party import colorama 19 from third_party import colorama
19 20
20 import auth 21 import auth
21 import subcommand 22 import subcommand
22 23
23 __version__ = '1.0' 24 __version__ = '1.0'
24 25
25 26
26 @subcommand.usage('<hostname>') 27 @subcommand.usage('<hostname>')
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 def main(argv): 88 def main(argv):
88 dispatcher = subcommand.CommandDispatcher(__name__) 89 dispatcher = subcommand.CommandDispatcher(__name__)
89 try: 90 try:
90 return dispatcher.execute(OptionParser(), argv) 91 return dispatcher.execute(OptionParser(), argv)
91 except auth.AuthenticationError as e: 92 except auth.AuthenticationError as e:
92 print >> sys.stderr, e 93 print >> sys.stderr, e
93 return 1 94 return 1
94 95
95 96
96 if __name__ == '__main__': 97 if __name__ == '__main__':
97 colorama.init() 98 colorama.init(wrap="TERM" not in os.environ)
98 try: 99 try:
99 sys.exit(main(sys.argv[1:])) 100 sys.exit(main(sys.argv[1:]))
100 except KeyboardInterrupt: 101 except KeyboardInterrupt:
101 sys.stderr.write('interrupted\n') 102 sys.stderr.write('interrupted\n')
102 sys.exit(1) 103 sys.exit(1)
OLDNEW
« no previous file with comments | « bootstrap/win/win_tools.bat ('k') | gclient.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698