Exemple #1
0
def YesOrNo(question):
    inp = cts.safeRawInput(question)
    inp = inp.lower().strip()
    if len(inp) > 0:
        if inp[0] == 'n':
            return No
        if inp[0] == 'y':
            return Yes
    return Invalid
Exemple #2
0
 
 while 1: # Create the copyright.txt if it isn't available
     val = YesOrNo("Do you wish to create " + copyright_txt + "? (y/n): ")
     if val == Yes:
         break
     if val == No:
         print "\nQuitting prepare script..."
         sys.exit()
 
 copyright_str = None
 
 while 1: # Let user write up the copyright file in command line.
     txt_buffer = []
     
     inp = cts.safeRawInput("----------------------------------------------------------\n"+
                     "Type the new copyright below. Press Enter twice to finish.\n"
                     +"----------------------------------------------------------\n")
     prev_valid = True
     while inp != "" or prev_valid:
     
         txt_buffer.append(inp+"\n")
     
         if inp == "":
             prev_valid = False
         else:
             prev_valid = True
     
         inp = cts.safeRawInput()
 
     val = Invalid