equal
deleted
inserted
replaced
401 readline.read_history_file |
401 readline.read_history_file |
402 except ImportError: |
402 except ImportError: |
403 pass |
403 pass |
404 return raw_input(prompt) |
404 return raw_input(prompt) |
405 |
405 |
406 def prompt(self, msg, pat=None, default="y"): |
406 def prompt(self, msg, pat=None, default="y", matchflags=0): |
407 if not self.interactive: return default |
407 if not self.interactive: return default |
408 try: |
408 try: |
409 r = self.readline(msg + ' ') |
409 r = self.readline(msg + ' ') |
410 if not pat or re.match(pat, r): |
410 if not pat or re.match(pat, r, matchflags): |
411 return r |
411 return r |
412 else: |
412 else: |
413 self.write(_("unrecognized response\n")) |
413 self.write(_("unrecognized response\n")) |
414 except EOFError: |
414 except EOFError: |
415 raise util.Abort(_('response expected')) |
415 raise util.Abort(_('response expected')) |