def confirm(self, prompt, default):
while True:<EOL><INDENT>try:<EOL><INDENT>self.write_confirm(prompt, default)<EOL>reply = self.readline('<STR_LIT>').strip().lower()<EOL><DEDENT>except EOFError:<EOL><INDENT>return default<EOL><DEDENT>if reply in ('<STR_LIT:y>', '<STR_LIT:yes>'):<EOL><INDENT>return True<EOL><DEDENT>elif reply in ('<STR_LIT:n>', '<STR_LIT>'):<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>self.msg("<STR_LIT>")<EOL>pass<EOL><DEDENT>pass<EOL><DEDENT>return default<EOL>
Called when a dangerous action is about to be done to make sure
        it's okay. `prompt' is printed; user response is returned.