mirror of
				https://github.com/KevinMidboe/tableprint.git
				synced 2025-10-29 18:00:16 +00:00 
			
		
		
		
	Removes ContextDecorator (unnecessary)
This commit is contained in:
		| @@ -14,7 +14,6 @@ from __future__ import print_function, unicode_literals | |||||||
| from six import string_types | from six import string_types | ||||||
| from collections import namedtuple | from collections import namedtuple | ||||||
| from numbers import Number | from numbers import Number | ||||||
| from contextlib import ContextDecorator |  | ||||||
| import sys | import sys | ||||||
| import re | import re | ||||||
| import numpy as np | import numpy as np | ||||||
| @@ -69,10 +68,10 @@ WIDTH = 11 | |||||||
| FMT = '5g' | FMT = '5g' | ||||||
|  |  | ||||||
|  |  | ||||||
| class Table(ContextDecorator): | class Table: | ||||||
|     def __init__(self, headers, width=WIDTH, style=STYLE, add_hr=True): |     def __init__(self, headers, width=WIDTH, style=STYLE, add_hr=True): | ||||||
|         self.headers = header(headers, width=WIDTH, style=STYLE, add_hr=add_hr) |         self.headers = header(headers, width=width, style=style, add_hr=add_hr) | ||||||
|         self.bottom = bottom(len(headers), width=WIDTH, style=STYLE) |         self.bottom = bottom(len(headers), width=width, style=style) | ||||||
|  |  | ||||||
|     def __call__(self, data): |     def __call__(self, data): | ||||||
|         print(row(data), flush=True) |         print(row(data), flush=True) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user