Code Monkey home page Code Monkey logo

Comments (2)

superatomic avatar superatomic commented on June 7, 2024 1

I've managed to solve the problem by calling get_current_context() in the __init__() method of the exception.

I would be willing to implement colored errors and submit a PR.

from click-help-colors.

superatomic avatar superatomic commented on June 7, 2024

I did some looking into this and there are some technical problems that make this difficult to implement. In theory, all that would need to be done would be to override the show() method for click.ClickException by either subclassing ClickException or by monkeypatching the class itself. However, when this method it called it is impossible to get the current click.Context with click.get_current_context(), which is needed to see if the color parameter is False.

Potentially, it might be possible for HelpColorsCommand to somehow hold on to the necessary Context, but I need to do more research into the problem.

from click-help-colors.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.