mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:42:02 +02:00
certbot: Flush output after write in IDisplay methods. (#5164)
- Update `notification`, `yesno`, `checklist`, `_print_menu`, and `_get_valid_int_ans` methods in `certbot.display.util.FileDisplay`. - Update `notification` method in `certbot.display.util.NoninteractiveDisplay`. Addresses issue #4879.
This commit is contained in:
@@ -117,6 +117,7 @@ class FileDisplay(object):
|
|||||||
self.outfile.write(
|
self.outfile.write(
|
||||||
"{line}{frame}{line}{msg}{line}{frame}{line}".format(
|
"{line}{frame}{line}{msg}{line}{frame}{line}".format(
|
||||||
line=os.linesep, frame=side_frame, msg=message))
|
line=os.linesep, frame=side_frame, msg=message))
|
||||||
|
self.outfile.flush()
|
||||||
if pause:
|
if pause:
|
||||||
if self._can_interact(force_interactive):
|
if self._can_interact(force_interactive):
|
||||||
input_with_timeout("Press Enter to Continue")
|
input_with_timeout("Press Enter to Continue")
|
||||||
@@ -213,6 +214,7 @@ class FileDisplay(object):
|
|||||||
|
|
||||||
self.outfile.write("{0}{frame}{msg}{0}{frame}".format(
|
self.outfile.write("{0}{frame}{msg}{0}{frame}".format(
|
||||||
os.linesep, frame=side_frame, msg=message))
|
os.linesep, frame=side_frame, msg=message))
|
||||||
|
self.outfile.flush()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
ans = input_with_timeout("{yes}/{no}: ".format(
|
ans = input_with_timeout("{yes}/{no}: ".format(
|
||||||
@@ -267,6 +269,7 @@ class FileDisplay(object):
|
|||||||
else:
|
else:
|
||||||
self.outfile.write(
|
self.outfile.write(
|
||||||
"** Error - Invalid selection **%s" % os.linesep)
|
"** Error - Invalid selection **%s" % os.linesep)
|
||||||
|
self.outfile.flush()
|
||||||
else:
|
else:
|
||||||
return code, []
|
return code, []
|
||||||
|
|
||||||
@@ -395,6 +398,7 @@ class FileDisplay(object):
|
|||||||
self.outfile.write(os.linesep)
|
self.outfile.write(os.linesep)
|
||||||
|
|
||||||
self.outfile.write(side_frame)
|
self.outfile.write(side_frame)
|
||||||
|
self.outfile.flush()
|
||||||
|
|
||||||
def _get_valid_int_ans(self, max_):
|
def _get_valid_int_ans(self, max_):
|
||||||
"""Get a numerical selection.
|
"""Get a numerical selection.
|
||||||
@@ -428,6 +432,7 @@ class FileDisplay(object):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
self.outfile.write(
|
self.outfile.write(
|
||||||
"{0}** Invalid input **{0}".format(os.linesep))
|
"{0}** Invalid input **{0}".format(os.linesep))
|
||||||
|
self.outfile.flush()
|
||||||
|
|
||||||
return OK, selection
|
return OK, selection
|
||||||
|
|
||||||
@@ -483,6 +488,7 @@ class NoninteractiveDisplay(object):
|
|||||||
self.outfile.write(
|
self.outfile.write(
|
||||||
"{line}{frame}{line}{msg}{line}{frame}{line}".format(
|
"{line}{frame}{line}{msg}{line}{frame}{line}".format(
|
||||||
line=os.linesep, frame=side_frame, msg=message))
|
line=os.linesep, frame=side_frame, msg=message))
|
||||||
|
self.outfile.flush()
|
||||||
|
|
||||||
def menu(self, message, choices, ok_label=None, cancel_label=None,
|
def menu(self, message, choices, ok_label=None, cancel_label=None,
|
||||||
help_label=None, default=None, cli_flag=None, **unused_kwargs):
|
help_label=None, default=None, cli_flag=None, **unused_kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user