style: fix linting issues in copypaste.py

This commit is contained in:
Paul Gauthier (aider) 2024-12-05 18:43:16 -08:00
parent 6f36a97c4a
commit 2a1065efc1

View file

@ -1,7 +1,9 @@
import threading import threading
import time import time
import pyperclip import pyperclip
class ClipboardWatcher: class ClipboardWatcher:
"""Watches clipboard for changes and updates IO placeholder""" """Watches clipboard for changes and updates IO placeholder"""
@ -29,6 +31,7 @@ class ClipboardWatcher:
except Exception as e: except Exception as e:
if self.verbose: if self.verbose:
from aider.dump import dump from aider.dump import dump
dump(f"Clipboard watcher error: {e}") dump(f"Clipboard watcher error: {e}")
continue continue
@ -44,13 +47,14 @@ class ClipboardWatcher:
self.watcher_thread = None self.watcher_thread = None
self.stop_event = None self.stop_event = None
def main(): def main():
"""Example usage of the clipboard watcher""" """Example usage of the clipboard watcher"""
from aider.io import InputOutput from aider.io import InputOutput
io = InputOutput() io = InputOutput()
watcher = ClipboardWatcher(io, verbose=True) watcher = ClipboardWatcher(io, verbose=True)
try: try:
watcher.start() watcher.start()
while True: while True:
@ -59,5 +63,6 @@ def main():
print("\nStopped watching clipboard") print("\nStopped watching clipboard")
watcher.stop() watcher.stop()
if __name__ == "__main__": if __name__ == "__main__":
main() main()