+ if choices is None:
+ choices = [('y', True, 'Perform the operation'),
+ ('n', False, 'Do not perform the operation')]
+ if not choices or not isinstance(choices, list):
+ raise errors.ProgrammerError("Invalid choiches argument to AskUser")
+ for entry in choices:
+ if not isinstance(entry, tuple) or len(entry) < 3 or entry[0] == '?':
+ raise errors.ProgrammerError("Invalid choiches element to AskUser")
+
+ answer = choices[-1][1]
+ new_text = []
+ for line in text.splitlines():
+ new_text.append(textwrap.fill(line, 70, replace_whitespace=False))
+ text = "\n".join(new_text)