From 8664725c7ba7dde4526209d58a73c6813aeb5497 Mon Sep 17 00:00:00 2001 From: kenkeiras Date: Wed, 5 Jul 2017 01:26:29 +0200 Subject: [PATCH] Fix disabling line wrapping. --- progress_meter.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/progress_meter.py b/progress_meter.py index 18a6dd0..54cddd8 100644 --- a/progress_meter.py +++ b/progress_meter.py @@ -11,18 +11,18 @@ class ProgressBar: // self.num_elements) blocks_to_go = total_blocks - blocks_done - print('\r' # Go to the start of the line - '\x1b[K' # Clear line - '\x1b[0m' # Restart the "style" - '\x1b[7l' # Disable line wrapping - '|' # Put the first "|" + print('\r' # Go to the start of the line + '\x1b[K' # Clear line + '\x1b[0m' # Restart the "style" + '\x1b[?7l' # Disable line wrapping + '|' # Put the first "|" + blocks_done * '█' # Completed blocks + blocks_to_go * ' ' # Uncompleted blocks + '\x1b[7m|\x1b[0m' # End the bar + ' ' - + msg # Add message - + '\x1b[7h' # Enable line wrapping - + '\r', # Go back to the start + + msg # Add message + + '\x1b[?7h' # Enable line wrapping + + '\r', # Go back to the start end='') def next_iter(self, msg=''):