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

underlined vs no_underline #11

Closed
salkinium opened this issue Sep 6, 2018 · 2 comments
Closed

underlined vs no_underline #11

salkinium opened this issue Sep 6, 2018 · 2 comments

Comments

@salkinium
Copy link

First, thanks for this great library, it takes away so much pain from working with this ANSI crap.

I created a wrap(string, style) function, that wraps a string in a style, then undoes that.
So wrap("hello", "underlined") would call something like getattr(colorful, style) + string + gettattr(coloful, "no_" + style).
The issue is there is no no_underlined, there's only no_underline.

https://github.com/timofurrer/colorful/blob/master/colorful/core.py#L320-L327

Looking at the list, there are a few renamings here, no_underline vs underline, no_blink vs blinkslow, no_reveal vs concealed (should be reveal or no_conceal), no_strikethrough vs struckthrough.

I think this can be fixed in a backwards-compatible way:

  1. Use active voice: dim, underline, inverse, conceal, strikethrough
  2. map {style} 1:1 to no_{style}
  3. maybe this to the translate_style function? ansi.MODIFIERS is already used in there, would reduce naming duplications.

cc @timofurrer

@timofurrer
Copy link
Owner

I've just released v0.4.4 with a fix :)

@salkinium
Copy link
Author

Thanks a lot!

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

No branches or pull requests

2 participants