#NEWLINE# def ask_for_confirmation( sql_sentences , model_full_name , interactive ) : #NEWLINE# #INDENT# print ( ( '\nSQL to synchronize "%s" schema:' % model_full_name ) ) #NEWLINE# for sentence in sql_sentences : #NEWLINE# #INDENT# print ( ( '   %s' % sentence ) ) #NEWLINE# #UNINDENT# while True : #NEWLINE# #INDENT# prompt = '\nAre you sure that you want to execute the previous SQL: (y/n) [n]: ' #NEWLINE# if interactive : #NEWLINE# #INDENT# answer = moves . input ( prompt ) . strip ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# answer = 'y' #NEWLINE# #UNINDENT# if ( answer == '' ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( answer not in ( 'y' , 'n' , 'yes' , 'no' ) ) : #NEWLINE# #INDENT# print ( 'Please answer yes or no' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( answer == 'y' ) or ( answer == 'yes' ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False