mirror of
https://github.com/KevinMidboe/tableprint.git
synced 2025-10-29 09:50:17 +00:00
Improves irregular table width for international languages
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ lib64/
|
|||||||
docs/_build
|
docs/_build
|
||||||
.coverage
|
.coverage
|
||||||
.mypy_cache/
|
.mypy_cache/
|
||||||
|
tags
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ Hosted at Read The Docs: [tableprint.readthedocs.org](http://tableprint.readthed
|
|||||||
## 🛠 Changelog
|
## 🛠 Changelog
|
||||||
| Version | Release Date | Description |
|
| Version | Release Date | Description |
|
||||||
| ---: | :---: | :--- |
|
| ---: | :---: | :--- |
|
||||||
|
| 0.8.0 | Oct 24 2017 | Improves support for international languages
|
||||||
| 0.7.0 | May 26 2017 | Adds a TableContext context manager for easy creation of dynamic tables (tables that update periodically). Adds the ability to pass a list or tuple of widths to specify different widths for different columns
|
| 0.7.0 | May 26 2017 | Adds a TableContext context manager for easy creation of dynamic tables (tables that update periodically). Adds the ability to pass a list or tuple of widths to specify different widths for different columns
|
||||||
| 0.6.9 | May 25 2017 | Splitting the tableprint.py module into a pacakge with multiple files
|
| 0.6.9 | May 25 2017 | Splitting the tableprint.py module into a pacakge with multiple files
|
||||||
| 0.6.7 | May 25 2017 | Fixes some bugs with ANSI escape sequences
|
| 0.6.7 | May 25 2017 | Fixes some bugs with ANSI escape sequences
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -57,7 +57,7 @@ setup(
|
|||||||
# project is installed. For an analysis of "install_requires" vs pip's
|
# project is installed. For an analysis of "install_requires" vs pip's
|
||||||
# requirements files see:
|
# requirements files see:
|
||||||
# https://packaging.python.org/en/latest/requirements.html
|
# https://packaging.python.org/en/latest/requirements.html
|
||||||
install_requires=['numpy', 'six', 'future'],
|
install_requires=['numpy', 'six', 'future', 'wcwidth'],
|
||||||
|
|
||||||
# List additional groups of dependencies here (e.g. development dependencies).
|
# List additional groups of dependencies here (e.g. development dependencies).
|
||||||
# You can install these using the following syntax, for example:
|
# You can install these using the following syntax, for example:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
__version__ = '0.7.0'
|
__version__ = '0.8.0'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
|
|
||||||
# Project description(s)
|
# Project description(s)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
Tableprint utilities
|
Tableprint utilities
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
from wcwidth import wcswidth
|
||||||
import re
|
import re
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ def humantime(time):
|
|||||||
|
|
||||||
def ansi_len(string):
|
def ansi_len(string):
|
||||||
"""Extra length due to any ANSI sequences in the string."""
|
"""Extra length due to any ANSI sequences in the string."""
|
||||||
return len(string) - len(re.compile(r'\x1b[^m]*m').sub('', string))
|
return len(string) - wcswidth(re.compile(r'\x1b[^m]*m').sub('', string))
|
||||||
|
|
||||||
|
|
||||||
def format_line(data, linestyle):
|
def format_line(data, linestyle):
|
||||||
|
|||||||
Reference in New Issue
Block a user