-
Notifications
You must be signed in to change notification settings - Fork 105
i18n: more accurate line width estimate...possible? #196
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
i18n: more accurate line width estimate...possible? #196
Conversation
…idth asian characters, accented latin characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @wimglenn!
CHANGELOG
Outdated
@@ -1,3 +1,11 @@ | |||
1.5.5 (unreleased) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be 1.6.0
as adds a new functionality. 👍
py/_io/terminalwriter.py
Outdated
def width_of_current_line(self): | ||
"""Return an estimate of the width so far in the current line. | ||
|
||
.. versionadded:: 1.5.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update version here as well please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to update the version in the places requested and we are good to go! 👍
@nicoddemus any idea what's going on in the appveyor build failure? doesn't look like any module I've touched? |
Hmmm seems like a flaky test, let me trigger the build again to confirm |
For example taking into account full width asian characters, combining accents in latin characters, etc. - it's not entirely trivial because Python module filenames can for example have accents.
This is going to be extremely difficult to handle correctly 100% of the time, without a big performance hit, and this is just a start (plus some testing) for trying to provide a number that may hopefully be more reliable than the string length.
pytest without this stuff:
pytest with this stuff: