From f03542b58444c4c0f3254742f97b54df13be1652 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 12 May 2024 22:16:16 +0200 Subject: [PATCH] fix(notify): output spacing --- .../feedback/management/commands/notify.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/shiftregister/feedback/management/commands/notify.py b/shiftregister/feedback/management/commands/notify.py index 66fc381..6b43982 100644 --- a/shiftregister/feedback/management/commands/notify.py +++ b/shiftregister/feedback/management/commands/notify.py @@ -89,31 +89,25 @@ class Command(BaseCommand): return + self.stderr.write() + all_messages = set(messages) sent_messages = set() - - self.stderr.write( - self.style.SUCCESS( - f"{'0'.rjust(len(str(len(all_messages))))} / {len(all_messages)}" - ), - ending="", - ) - error = None try: for message in send(all_messages): sent_messages.add(message) + self.stderr.write() self.stderr.write( self.style.SUCCESS( f"\r{str(len(sent_messages)).rjust(len(str(len(all_messages))))} / {len(all_messages)}" - ), - ending="", + ) ) + self.stderr.write() except Exception as e: error = e - self.stderr.write() self.stderr.write( self.style.WARNING(f"sent {len(sent_messages)} out of {len(all_messages)}") )