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