From 9ba26df887ef38f87390dde401c743d8f9fee3cd Mon Sep 17 00:00:00 2001 From: Niru Maheswaranathan Date: Tue, 23 May 2017 13:59:11 -0700 Subject: [PATCH] Removes ContextDecorator (unnecessary) --- tableprint.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tableprint.py b/tableprint.py index ee25646..2c21db0 100644 --- a/tableprint.py +++ b/tableprint.py @@ -14,7 +14,6 @@ from __future__ import print_function, unicode_literals from six import string_types from collections import namedtuple from numbers import Number -from contextlib import ContextDecorator import sys import re import numpy as np @@ -69,10 +68,10 @@ WIDTH = 11 FMT = '5g' -class Table(ContextDecorator): +class Table: def __init__(self, headers, width=WIDTH, style=STYLE, add_hr=True): - self.headers = header(headers, width=WIDTH, style=STYLE, add_hr=add_hr) - self.bottom = bottom(len(headers), width=WIDTH, style=STYLE) + self.headers = header(headers, width=width, style=style, add_hr=add_hr) + self.bottom = bottom(len(headers), width=width, style=style) def __call__(self, data): print(row(data), flush=True)