From d536d7cb34ba06afac21199104c5fa9ac8da88e5 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Tue, 12 Dec 2023 20:51:02 +0200 Subject: [PATCH] Update the style of messages. --- notification_producer/producer_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notification_producer/producer_client.py b/notification_producer/producer_client.py index 559046b..a6b30c9 100644 --- a/notification_producer/producer_client.py +++ b/notification_producer/producer_client.py @@ -53,9 +53,9 @@ class ProducerClient: try: while True: - print('Your notification: ') - title = input('title: ') - message = input('message: ') + self.console.print('\n[cyan b]Your notification[/]: ') + title = Prompt.ask('[cyan]title[/]') + message = Prompt.ask('[cyan]message[/]') await self.send_notification(title, message) if title == '' and message == '': @@ -66,8 +66,8 @@ class ProducerClient: except asyncio.CancelledError: pass except KeyboardInterrupt: - print("\nbye") await self.send_notification('', '') + self.console.print("\n[green]bye[/]") sys.exit(0) finally: self.writer.close()