http://mmgen-wallet.i2p/project/mmgen/mmgen-wallet/commit/35ddbc029c29e0d04fb444b9e4481f269d84e34a
= "YES": msg("Program aborted by user") sys.exit(2) msg("") +def user_confirm(prompt,default_yes=False): + + q = "(Y/n)" if default_yes else "(y/N)" + + while True: + reply = get_char("%s %s: " % (prompt, q)).strip() + msg("") + + if not reply: + return True if default_yes else False + elif reply in 'yY': return True + elif reply in 'nN': return False + else: msg("Invalid reply") + + def set_if_unset_and_typeconvert(opts,item): for opt,var,dtype in item: @@ -282,10 +315,10 @@ just hit ENTER twice....