~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-06-30 06:35:06 UTC
  • mfrom: (4491.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090630063506-f7wlyoa0ldu816g0
(mbp) accept uppercase Y/N from 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'):