comparison mercurial/ui.py @ 18054:b35e3364f94a

check-code: there must also be whitespace between ')' and operator The check pattern only checked for whitespace between keyword and operator. Now it also warns: > x = f(),7 missing whitespace after , > x = f()+7 missing whitespace in expression
author Mads Kiilerich <madski@unity3d.com>
date Sun, 09 Dec 2012 23:33:16 +0100
parents e7cfe3587ea4
children 18242716a014
comparison
equal deleted inserted replaced
18053:0c2f0048125d 18054:b35e3364f94a
611 one of the provided choices. The index of the choice is returned. 611 one of the provided choices. The index of the choice is returned.
612 choices is a sequence of acceptable responses with the format: 612 choices is a sequence of acceptable responses with the format:
613 ('&None', 'E&xec', 'Sym&link') Responses are case insensitive. 613 ('&None', 'E&xec', 'Sym&link') Responses are case insensitive.
614 If ui is not interactive, the default is returned. 614 If ui is not interactive, the default is returned.
615 """ 615 """
616 resps = [s[s.index('&')+1].lower() for s in choices] 616 resps = [s[s.index('&') + 1].lower() for s in choices]
617 while True: 617 while True:
618 r = self.prompt(msg, resps[default]) 618 r = self.prompt(msg, resps[default])
619 if r.lower() in resps: 619 if r.lower() in resps:
620 return resps.index(r.lower()) 620 return resps.index(r.lower())
621 self.write(_("unrecognized response\n")) 621 self.write(_("unrecognized response\n"))