[PATCH 2 of 3] ui: prompt_key -- like prompt, but inputs only one keystroke
Bryan O'Sullivan
bos at serpentine.com
Tue Dec 25 23:07:01 CST 2007
Kirill Smelkov wrote:
> - def prompt(self, msg, pat=None, default="y", matchflags=0):
> + def prompt(self, msg, pat=None, default="y", matchflags=0, inputflags=0):
> if not self.interactive: return default
> try:
> - r = self._readline(msg + ' ')
> + if inputflags & INPUT_KEYSTROKE:
> + self.write(msg + ' ')
> + self.flush()
> + r = util.getch()
> + self.write(r + '\n')
> + else:
> + r = self._readline(msg + ' ')
> +
It will be less work to simply write a new function instead of crufting
this one up.
<b
More information about the Mercurial-devel
mailing list