aboutsummaryrefslogtreecommitdiffstats
path: root/tabletext.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2014-08-13 02:43:29 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2014-08-13 02:43:29 -0400
commitb18bef7a4a172d65b8f0af03801ce2f92daa3279 (patch)
tree7bd4b0b5fae1292c44ded25cb03ad2676982ef14 /tabletext.py
parenta4ea3606267b8e8606b9eabf25940c3366bf679c (diff)
downloadtabletext-b18bef7a4a172d65b8f0af03801ce2f92daa3279.tar.gz
Fix bug when width is zero
Diffstat (limited to 'tabletext.py')
-rw-r--r--tabletext.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tabletext.py b/tabletext.py
index 1245d26..2d78f5c 100644
--- a/tabletext.py
+++ b/tabletext.py
@@ -46,6 +46,8 @@ def format_row(row, formats, padding, ver):
def add_width(format_string, width):
+ if width == 0:
+ return format_string
regexp = r",?(\.\d+)?(b|c|d|e|E|f|F|g|G|n|o|s|x|X|%)?"
match = re.match(regexp, format_string)
begin, end = match.span()