X-Git-Url: https://code.grnet.gr/git/snf-image-creator/blobdiff_plain/5f7e1e0c312dd626cc0d4a0f78c86d440948f229..4a847a9870e0eebb5efff3012e4eaaf5974735f1:/image_creator/output/cli.py diff --git a/image_creator/output/cli.py b/image_creator/output/cli.py index c7b5a55..37022d5 100644 --- a/image_creator/output/cli.py +++ b/image_creator/output/cli.py @@ -58,6 +58,12 @@ def success(msg, new_line=True, colored=True): output(msg, new_line, color) +def clear(): + #clear the page + if sys.stderr.isatty(): + sys.stderr.write('\033[H\033[2J') + + class SilentOutput(Output): pass @@ -78,6 +84,9 @@ class SimpleOutput(Output): def output(self, msg='', new_line=True): output(msg, new_line) + def clear(self): + clear() + class OutputWthProgress(SimpleOutput): class _Progress(Bar):