Ensure we end with a newline in normal mode

This commit is contained in:
Dag Wieers 2016-03-17 18:42:16 +01:00 committed by Brian Coca
parent 7148023f59
commit 221a4e7014

View file

@ -35,9 +35,9 @@ import sys
# #
# + On screen there should only be relevant stuff # + On screen there should only be relevant stuff
# - How far are we ? (during run, last line) # - How far are we ? (during run, last line)
# - What issues did we have # - What issues occurred
# - What changes have occured # - What changes occurred
# - Diff output # - Diff output (in diff-mode)
# #
# + If verbosity increases, act as default output # + If verbosity increases, act as default output
# So that users can easily switch to default for troubleshooting # So that users can easily switch to default for troubleshooting
@ -424,15 +424,16 @@ class CallbackModule_dense(CallbackModule_default):
sys.stdout.flush() sys.stdout.flush()
def v2_playbook_on_stats(self, stats): def v2_playbook_on_stats(self, stats):
# In normal mode screen output should be sufficient if self.keep:
sys.stdout.write(ansi.restore + '\n' + ansi.save + ansi.reset + ansi.clearline)
else:
sys.stdout.write(ansi.restore + ansi.reset + ansi.clearline)
# In normal mode screen output should be sufficient, summary is redundant
if self._display.verbosity == 0: if self._display.verbosity == 0:
return return
if self.keep: sys.stdout.write(ansi.bold + ansi.underline)
sys.stdout.write(ansi.restore + '\n' + ansi.save + ansi.clearline + ansi.bold)
else:
sys.stdout.write(ansi.restore + ansi.clearline + ansi.bold)
sys.stdout.write('SUMMARY') sys.stdout.write('SUMMARY')
sys.stdout.write(ansi.restore + '\n' + ansi.save + ansi.reset + ansi.clearline) sys.stdout.write(ansi.restore + '\n' + ansi.save + ansi.reset + ansi.clearline)