summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-08-15 15:33:51 +0300
committerimarom <imarom@cisco.com>2016-08-15 16:33:41 +0300
commit25aa665b7e5a5e8747735aaaa5a00dba11b21067 (patch)
tree75f6fc67584dbcba8a72b44ed5384f24e0eef698 /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
parentba7b5dff853a3b11b0cc2e7b29cfc1cd99e606f7 (diff)
TUI screen buffer
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
index 4b7e9b3e..393ba111 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
@@ -1,7 +1,10 @@
+from __future__ import print_function
+
import sys
from texttable import Texttable
from .text_opts import format_text
+
class TRexTextTable(Texttable):
def __init__(self):
@@ -21,11 +24,11 @@ class TRexTextInfo(Texttable):
def generate_trex_stats_table():
pass
-def print_table_with_header(texttable_obj, header="", untouched_header=""):
+def print_table_with_header(texttable_obj, header="", untouched_header="", buffer=sys.stdout):
header = header.replace("_", " ").title() + untouched_header
- print(format_text(header, 'cyan', 'underline') + "\n")
+ print(format_text(header, 'cyan', 'underline') + "\n", file=buffer)
- print((texttable_obj.draw() + "\n"))
+ print((texttable_obj.draw() + "\n"), file=buffer)
if __name__ == "__main__":
pass