mirror of
https://github.com/KevinMidboe/tableprint.git
synced 2025-10-29 01:40:17 +00:00
Fixes ANSI escape in headers
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ lib64/
|
||||
*.zip
|
||||
docs/_build
|
||||
.coverage
|
||||
.mypy_cache/
|
||||
|
||||
2
setup.py
2
setup.py
@@ -6,7 +6,7 @@ setup(
|
||||
# Versions should comply with PEP440. For a discussion on single-sourcing
|
||||
# the version across setup.py and the project code, see
|
||||
# https://packaging.python.org/en/latest/single_source_version.html
|
||||
version='0.6.0',
|
||||
version='0.6.1',
|
||||
|
||||
description='Pretty console printing of tabular data',
|
||||
long_description='''Formatted console printing of tabular data.
|
||||
|
||||
@@ -132,7 +132,7 @@ def header(headers, width=WIDTH, style=STYLE, add_hr=True):
|
||||
tablestyle = styles[style]
|
||||
|
||||
# string formatter
|
||||
data = map(lambda x: ('{:^%d}' % width).format(x), headers)
|
||||
data = map(lambda x: ('{:^%d}' % (width + _ansi_len(x))).format(x), headers)
|
||||
|
||||
# build the formatted str
|
||||
headerstr = _format_line(data, tablestyle.row)
|
||||
|
||||
Reference in New Issue
Block a user