From ccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 May 2006 23:27:35 +0000 Subject: Revert patch for r3426 for bug 134466 and add warnings to docs. svn path=/main/trunk/; revision=3437 --- bin/emerge | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin/emerge') diff --git a/bin/emerge b/bin/emerge index 49f68a411..2b2a72fcb 100755 --- a/bin/emerge +++ b/bin/emerge @@ -109,7 +109,8 @@ def normpath(mystr): def userquery(prompt, responses=None, colours=None): """Displays a prompt and a set of responses, then waits for a response which is checked against the responses and the first to match is - returned. + returned. An empty response will match the first value in responses. The + input buffer is *not* cleared prior to the prompt! prompt: a String. responses: a List of Strings. @@ -133,7 +134,8 @@ def userquery(prompt, responses=None, colours=None): while True: response=raw_input("["+string.join([colours[i](responses[i]) for i in range(len(responses))],"/")+"] ") for key in responses: - if response and response.upper()==key[:len(response)].upper(): + # An empty response will match the first value in responses. + if response.upper()==key[:len(response)].upper(): return key print "Sorry, response '%s' not understood." % response, except (EOFError, KeyboardInterrupt): -- cgit v1.2.3-1-g7c22