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-03-29 11:09:55 +0300
committerimarom <imarom@cisco.com>2016-03-29 11:09:55 +0300
commite482f78cf93b8d4ad4641d83276a4fa6d9744e42 (patch)
tree94d17660247294099be9ec413b8b43f35d974828 /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
parentdd5fb4a71be0964d9a904af02b4010d87f28f66b (diff)
TUI fixup
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.py7
1 files changed, 6 insertions, 1 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 8917cd28..75adf9e3 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,3 +1,4 @@
+import sys
from texttable import Texttable
from .text_opts import format_text
@@ -23,7 +24,11 @@ def generate_trex_stats_table():
def print_table_with_header(texttable_obj, header="", untouched_header=""):
header = header.replace("_", " ").title() + untouched_header
print(format_text(header, 'cyan', 'underline') + "\n")
- print((texttable_obj.draw() + "\n"))
+
+ if sys.version_info < (3,0):
+ print((texttable_obj.draw().encode('utf-8') + "\n"))
+ else:
+ print((texttable_obj.draw() + "\n"))
if __name__ == "__main__":
pass