Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch possible pyperclip exception if no clipboard mechanism installed #98

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

seapagan
Copy link
Contributor

@seapagan seapagan commented Aug 30, 2024

On Ubuntu at least, there is often no terminal clipboard handler (ie 'xclip') installed by default. In this case, trying to copy the Response will crash with a traceback and lose any work.

This PR just catches that exception and puts the output into a notification, which in turn points to a website with more info.

I actually have the same PR open on your elia project, which uses the exact same code 😉

Edit:
I've just noticed that my editor config has sorted the imports a little bit to Ruff standards, sorry 😊. If you want me to undo that bit I can.

@seapagan seapagan marked this pull request as ready for review August 30, 2024 17:22
Copy link
Owner

@darrenburns darrenburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@darrenburns darrenburns merged commit 1f4c014 into darrenburns:main Sep 4, 2024
1 check passed
@seapagan seapagan deleted the catch-clipboard-exception branch September 4, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants