# HG changeset patch # User Volker Freudenthaler # Date 1479137492 -3600 # Node ID a69e0c8ca55cf42846a8fe733d893921198a0e5f # Parent 349178d9e65888dcd43e3d630736517ded1bac72 Code under MIT licence removed and replaced by def user_yes_no_query(question) diff -r 349178d9e658 -r a69e0c8ca55c lidar_correction_ghk.py --- a/lidar_correction_ghk.py Mon Nov 14 16:32:01 2016 +0200 +++ b/lidar_correction_ghk.py Mon Nov 14 16:31:32 2016 +0100 @@ -68,32 +68,6 @@ #if user_yes_no_query('want to exit?') == 1: sys.exit() -''' -## {{{ http://code.activestate.com/recipes/577058/ (r2) -def query_yes_no(question, default="yes"): - valid = {"yes":"yes", "y":"yes", "ye":"yes", - "no":"no", "n":"no"} - if default == None: - prompt = " [y/n] " - elif default == "yes": - prompt = " [Y/n] " - elif default == "no": - prompt = " [y/N] " - else: - raise ValueError("invalid default answer: '%s'" % default) - - while 1: - sys.stdout.write(question + prompt) - choice = input().lower() - if default is not None and choice == '': - return default - elif choice in valid.keys(): - return valid[choice] - else: - sys.stdout.write("Please respond with 'yes' or 'no' "\ - "(or 'y' or 'n').\n") -## end of http://code.activestate.com/recipes/577058/ }}} -''' abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) fname = os.path.basename(abspath)