diff options
Diffstat (limited to 'linaropy/rninput.py')
-rw-r--r-- | linaropy/rninput.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/linaropy/rninput.py b/linaropy/rninput.py index d440a5b..6f4e346 100644 --- a/linaropy/rninput.py +++ b/linaropy/rninput.py @@ -1,6 +1,8 @@ # For fileIO import os.path +from colors import * + # @message - The question to display to the user. # @default - The default if <enter> is hit. # @accept - The list of valid responses. @@ -19,7 +21,7 @@ def yninput(message, default="n", accept=['yes', 'y', 'no', 'n'], retry=True): default_msg = " [Y/n]: " while(1): - answer = raw_input(message + default_msg) or default.lower() + answer = raw_input(BLUE + "** " + NC + BOLD + message + default_msg + NC) or default.lower() if answer.lower() not in accept and retry: print "'%s' is an invalid response. Please try again." % answer.lower() continue @@ -33,7 +35,7 @@ def yninput(message, default="n", accept=['yes', 'y', 'no', 'n'], retry=True): def finput(message, orval): while(1): - answer = raw_input(message) or orval + answer = raw_input(BLUE + "** " + NC + BOLD + message + NC) or orval if os.path.exists(answer) and os.path.isfile(answer): return answer |