I'm using the blessings module:
https://pypi.python.org/pypi/blessings/
for coloring field contents. It handles a lot of the ugliness of terminal
escape codes, etc. nicely, but at least with my setup, I'm getting fields that
are off by one character.
I've isolated the problem to the fact that blessings is adding a 0x0f (Ctrl-O)
character as part of the term.normal() command that returns to the default
formatting -- I believe this comes from the "sgr0" terminfo capability
The fix is to simply add 0x0f to the "special characters" in the
_char_block_width() fuction, e.g.:
# Other control characters
elif char in (0x0000, 0x001f, 0x000f):
return 0
Just wanted to note this as an issue so it can be fixed for anyone else using
blessings and prettytable together.
Original issue reported on code.google.com by tonyc...@gmail.com on 16 May 2014 at 5:04
Original issue reported on code.google.com by
tonyc...@gmail.com
on 16 May 2014 at 5:04