From af4f224c0022a9d1a9437f9f20c772ca31463c6f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 23 Jan 2024 10:02:07 -0800 Subject: [PATCH] cleanup --- aider/mdstream.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/aider/mdstream.py b/aider/mdstream.py index d95d2bb71..b04cd0252 100755 --- a/aider/mdstream.py +++ b/aider/mdstream.py @@ -40,23 +40,6 @@ The end. """ # noqa: E501 -def showit(lines): - return - - num_lines = len(lines) - d = 10 - if num_lines < d: - start = 0 - else: - start = num_lines - d - - print("-" * 50) - for i in range(start, num_lines): - line = repr(lines[i])[:70] - print(f"{i:02d}:{line}") - print("-" * 50) - - class MarkdownStream: live = None when = 0 @@ -75,7 +58,8 @@ class MarkdownStream: self.live.start() def __del__(self): - self.live.stop() + if self.live: + self.live.stop() def update(self, text, final=False): now = time.time() @@ -115,6 +99,7 @@ class MarkdownStream: if final: self.live.update(Text("")) self.live.stop() + self.live = None else: rest = lines[num_lines:] rest = "".join(rest)