From 19b2a231b39206c414ede51a15a44cd0a67f20e2 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Tue, 12 Dec 2023 20:48:33 +0200 Subject: [PATCH] Add the connection message. --- notification_producer/producer_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notification_producer/producer_client.py b/notification_producer/producer_client.py index 76a32b3..ae4e234 100644 --- a/notification_producer/producer_client.py +++ b/notification_producer/producer_client.py @@ -21,10 +21,13 @@ import asyncio import struct import sys +from rich.console import Console +from rich.prompt import Prompt class ProducerClient: BUFFER_SIZE = 1024 + console = Console() def __init__(self, ip: str, port: int): self.__ip = ip @@ -34,6 +37,7 @@ class ProducerClient: async def connect(self): self.reader, self.writer = await asyncio.open_connection(self.__ip, self.__port) + self.console.print(f'[yellow b][INFO][/] Connected to the server ({self.__ip}:{self.__port}).') async def send(self, message: str): self.writer.write(struct.pack('