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

Side by Side Diff: drover.py

Issue 414060: On prompts don't add a new line when printing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 1 month 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 | Annotate | Revision Log
« 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 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import optparse 5 import optparse
6 import os 6 import os
7 import re 7 import re
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 import webbrowser 10 import webbrowser
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 """ 330 """
331 map = [] 331 map = []
332 for file_info in files_info: 332 for file_info in files_info:
333 map.append(file_info[2] + "/" + file_info[3]) 333 map.append(file_info[2] + "/" + file_info[3])
334 return map 334 return map
335 335
336 def prompt(question): 336 def prompt(question):
337 answer = None 337 answer = None
338 338
339 while not answer: 339 while not answer:
340 print question + " [y|n]:" 340 print question + " [y|n]:",
341 answer = sys.stdin.readline() 341 answer = sys.stdin.readline()
342 if answer.lower().startswith('n'): 342 if answer.lower().startswith('n'):
343 return False 343 return False
344 elif answer.lower().startswith('y'): 344 elif answer.lower().startswith('y'):
345 return True 345 return True
346 else: 346 else:
347 answer = None 347 answer = None
348 348
349 def text_prompt(question, default): 349 def text_prompt(question, default):
350 print question + " [" + default + "]:" 350 print question + " [" + default + "]:"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 if not options.merge and not options.revert: 483 if not options.merge and not options.revert:
484 option_parser.error("You need at least --merge or --revert") 484 option_parser.error("You need at least --merge or --revert")
485 sys.exit(1) 485 sys.exit(1)
486 486
487 if options.merge and not options.branch: 487 if options.merge and not options.branch:
488 option_parser.error("--merge requires a --branch") 488 option_parser.error("--merge requires a --branch")
489 sys.exit(1) 489 sys.exit(1)
490 490
491 sys.exit(main(options, args)) 491 sys.exit(main(options, args))
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