/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Martin Pool
  • Date: 2009-06-30 05:34:47 UTC
  • mto: This revision was merged to the branch mainline in revision 4492.
  • Revision ID: mbp@sourcefrog.net-20090630053447-q7j4q6caq250311m
Accept uppercase Y/N in get_boolean

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        self.stderr = stderr or sys.stderr
158
158
 
159
159
    def get_boolean(self, prompt):
160
 
        # FIXME: make a regexp and handle case variations as well.
161
160
        while True:
162
161
            self.prompt(prompt + "? [y/n]: ")
163
162
            line = self.stdin.readline()
 
163
            line = line.lower()
164
164
            if line in ('y\n', 'yes\n'):
165
165
                return True
166
166
            if line in ('n\n', 'no\n'):