From 7794877876ed00ea5e91a5c11b2fabb4618bf54c Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Wed, 27 Jul 2016 00:37:32 +0200 Subject: [PATCH] setup: improve support for prompts, we should not take care of case sensitivity here --- rhodecode/lib/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py index e5d4faea..d276f906 100644 --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -352,17 +352,17 @@ def is_valid_repo_group(repo_group_name, base_path, skip_path_check=False): return False -def ask_ok(prompt, retries=4, complaint='Yes or no please!'): +def ask_ok(prompt, retries=4, complaint='[y]es or [n]o please!'): while True: ok = raw_input(prompt) - if ok in ('y', 'ye', 'yes'): + if ok.lower() in ('y', 'ye', 'yes'): return True - if ok in ('n', 'no', 'nop', 'nope'): + if ok.lower() in ('n', 'no', 'nop', 'nope'): return False retries = retries - 1 if retries < 0: raise IOError - print complaint + print(complaint) # propagated from mercurial documentation ui_sections = [