From 7c5fa336cf28b1e875ff5d776f32e6bd4ba15d2f Mon Sep 17 00:00:00 2001 From: brianbterry Date: Tue, 25 Mar 2025 02:29:02 -0500 Subject: [PATCH] Update app.py Removed duplicated function body in new location --- loader-animation/app.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/loader-animation/app.py b/loader-animation/app.py index dffd0593..3255abee 100644 --- a/loader-animation/app.py +++ b/loader-animation/app.py @@ -33,30 +33,6 @@ async def send_animated_message( except asyncio.CancelledError: msg.content = base_msg await msg.update() # Final static message - base_msg: str, - frames: List[str], - interval: float = 0.8 -) -> None: - """Display animated message with minimal resource usage""" - msg = cl.Message(content=base_msg) - await msg.send() - - progress = 0 - bar_length = 12 # Optimal length for progress bar - - try: - while True: - # Efficient progress calculation - current_frame = frames[progress % len(frames)] - progress_bar = ("▣" * (progress % bar_length)).ljust(bar_length, "▢") - - # Single update operation - await msg.update(content=f"{current_frame} {base_msg}\n{progress_bar}") - - progress += 1 - await asyncio.sleep(interval) - except asyncio.CancelledError: - await msg.update(content=base_msg) # Final static message @cl.on_message async def main(message: cl.Message) -> None: @@ -76,4 +52,4 @@ async def main(message: cl.Message) -> None: await cl.Message(content="Done!").send() else: - await cl.Message(content="Send 'test animation'").send() \ No newline at end of file + await cl.Message(content="Send 'test animation'").send()