From 6107c1ca4aa485c5971ff3326513b8f4934f7ac1 Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 8 Feb 2016 10:55:20 -0500 Subject: huge refactor - again --- .../stl/trex_stl_lib/utils/text_tables.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py') 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 new file mode 100644 index 00000000..07753fda --- /dev/null +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py @@ -0,0 +1,31 @@ +from texttable import Texttable +from text_opts import format_text + +class TRexTextTable(Texttable): + + def __init__(self): + Texttable.__init__(self) + # set class attributes so that it'll be more like TRex standard output + self.set_chars(['-', '|', '-', '-']) + self.set_deco(Texttable.HEADER | Texttable.VLINES) + +class TRexTextInfo(Texttable): + + def __init__(self): + Texttable.__init__(self) + # set class attributes so that it'll be more like TRex standard output + self.set_chars(['-', ':', '-', '-']) + self.set_deco(Texttable.VLINES) + +def generate_trex_stats_table(): + pass + +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").encode('utf-8') + +if __name__ == "__main__": + pass + -- cgit 1.2.3-korg