Merge pull request #4813 from certbot/keep-space

Keep trailing space on prompt
This commit is contained in:
Noah Swartz
2017-06-09 15:22:27 -07:00
committed by GitHub
+5 -12
View File
@@ -176,12 +176,9 @@ class FileDisplay(object):
if self._return_default(message, default, cli_flag, force_interactive):
return OK, default
ans = input_with_timeout(
textwrap.fill(
"%s (Enter 'c' to cancel): " % message,
80,
break_long_words=False,
break_on_hyphens=False))
# Trailing space must be added outside of _wrap_lines to be preserved
message = _wrap_lines("%s (Enter 'c' to cancel):" % message) + " "
ans = input_with_timeout(message)
if ans == "c" or ans == "C":
return CANCEL, "-1"
@@ -392,12 +389,8 @@ class FileDisplay(object):
# Write out the menu choices
for i, desc in enumerate(choices, 1):
self.outfile.write(
textwrap.fill(
"{num}: {desc}".format(num=i, desc=desc),
80,
break_long_words=False,
break_on_hyphens=False))
msg = "{num}: {desc}".format(num=i, desc=desc)
self.outfile.write(_wrap_lines(msg))
# Keep this outside of the textwrap
self.outfile.write(os.linesep)