diff options
author | 2016-01-12 08:01:27 -0500 | |
---|---|---|
committer | 2016-01-12 08:04:12 -0500 | |
commit | 7ce793d732d7692a60672db7f9e4f1bac9cad81e (patch) | |
tree | 640054df4d97d41725df3c4a54094b0561479fbe /scripts/external_libs | |
parent | 0f49e42f202491f7d8e23be237f9c94f136fe384 (diff) |
some modifactions to the TUI
few things were fixed
Diffstat (limited to 'scripts/external_libs')
-rw-r--r-- | scripts/external_libs/texttable-0.8.4/texttable.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/external_libs/texttable-0.8.4/texttable.py b/scripts/external_libs/texttable-0.8.4/texttable.py index 684e63bd..d0348f6c 100644 --- a/scripts/external_libs/texttable-0.8.4/texttable.py +++ b/scripts/external_libs/texttable-0.8.4/texttable.py @@ -98,6 +98,7 @@ Maximilian Hils: import sys import string +from common import text_opts try: if sys.version >= '2.3': @@ -128,6 +129,10 @@ def len(iterable): return iterable.__len__() +def ansi_len (iterable): + return len(text_opts.TextCodesStripper.strip(iterable)) + + class ArraySizeError(Exception): """Exception raised when specified rows don't fit the required size """ @@ -532,7 +537,7 @@ class Texttable: for cell, width, align in zip(line, self._width, self._align): length += 1 cell_line = cell[i] - fill = width - len(cell_line) + fill = width - ansi_len(cell_line) if isheader: align = "c" if align == "r": @@ -569,7 +574,11 @@ class Texttable: c = str(c, 'utf', 'replace') else: c = unicode(c, 'utf', 'replace') - array.extend(textwrap.wrap(c, width)) + + # imarom - no wrap for now + #array.extend(textwrap.wrap(c, width)) + array.extend([c]) + line_wrapped.append(array) max_cell_lines = reduce(max, list(map(len, line_wrapped))) for cell, valign in zip(line_wrapped, self._valign): |