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

Define feud.click.is_rich to check if rich_click is installed #130

Closed
1 task done
eonu opened this issue Dec 27, 2023 · 1 comment
Closed
1 task done

Define feud.click.is_rich to check if rich_click is installed #130

eonu opened this issue Dec 27, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@eonu
Copy link
Owner

eonu commented Dec 27, 2023

Does this suggestion already exist?

  • This is a new feature!

Feature description

There is currently no easy way to check whether rich_click is installed and being used.

A simple way to do this is to change:

try:
from rich_click import *
except ImportError:
from click import *

To:

#: Whether ``rich_click`` is installed or not.
is_rich: bool

try: 
    from rich_click import * 
    is_rich = True
except ImportError: 
    from click import * 
    is_rich = False

Then feud.click.is_rich can be used within the code base or by the user.

Existing parts of the code base relying on similar checks should be updated to re-use this variable.

@eonu
Copy link
Owner Author

eonu commented Dec 27, 2023

Fixed in #132.

@eonu eonu closed this as completed Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant