Commit graph

10 commits

Author SHA1 Message Date
Paul Gauthier
3e96fda71a catch shutdown errors 2024-01-23 10:45:58 -08:00
Paul Gauthier
af4f224c00 cleanup 2024-01-23 10:02:07 -08:00
Paul Gauthier
580c52bd85 set mdargs on init 2024-01-23 09:58:57 -08:00
Paul Gauthier
da131da427 aider: Add __del__ method to MarkdownStream to call self.live.stop().
# Aider chat conversation:

USER: make sire self.live.stop() is called no matter how the object gets destroyed

ASSISTANT: To ensure that `self.live.stop()` is called no matter how the object gets destroyed, we can use Python's built-in `__del__` method. This method is called when an object is about to be destroyed. We can override this method in our `MarkdownStream` class to stop the `Live` instance.

Here are the steps to make this change:

1. Add a `__del__` method to the `MarkdownStream` class that calls `self.live.stop()`.

Here is the *SEARCH/REPLACE* block:

aider/mdstream.py
<source>python
<<<<<<< SEARCH
class MarkdownStream:
    live = None
    when = 0
    min_delay = 0.050
    live_window = 6

    def __init__(self):
        self.printed = []

        self.live = Live(Text(''), refresh_per_second=1./self.min_delay)
        self.live.start()
=======
class MarkdownStream:
    live = None
    when = 0
    min_delay = 0.050
    live_window = 6

    def __init__(self):
        self.printed = []

        self.live = Live(Text(''), refresh_per_second=1./self.min_delay)
        self.live.start()

    def __del__(self):
        self.live.stop()
>>>>>>> REPLACE
</source>
2024-01-23 09:50:27 -08:00
Paul Gauthier
24f1e01177 Refactored MarkdownStream to use rich.live for real-time updates and improved text rendering. 2024-01-23 09:50:23 -08:00
Paul Gauthier
b143bc56ac switch to mdstream 2024-01-23 09:20:31 -08:00
Paul Gauthier
e50a0e8b09 noop 2024-01-23 08:55:28 -08:00
Paul Gauthier
85383079f6 cleanup 2024-01-23 08:55:08 -08:00
Paul Gauthier
e6a4edf2e2 aider: Mark _text as noqa 501.
# Aider chat conversation:

USER: mark _text as noqa 501

ASSISTANT: To mark `_text` as `noqa 501`, we need to modify `aider/mdstream.py`:

1. Add `# noqa: 501` at the end of the `_text` variable declaration.

Here is the *SEARCH/REPLACE* block:

aider/mdstream.py
<source>python
<<<<<<< SEARCH
_text = 5 * _text
=======
_text = 5 * _text  # noqa: 501
>>>>>>> REPLACE
</source>
2024-01-23 08:53:34 -08:00
Paul Gauthier
c051104dc0 Add MarkdownStream class for displaying markdown content in a stream. 2024-01-23 08:53:29 -08:00