From f72c6df9d2e9998ae1f3529d729ab7930b35785a Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 21 Mar 2016 14:48:00 +0200 Subject: python 3 support for package - phase 1 --- .../trex_control_plane/stl/trex_stl_lib/utils/text_opts.py | 4 ++-- .../trex_control_plane/stl/trex_stl_lib/utils/text_tables.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py index 78a0ab1f..bc2d44f4 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py @@ -19,8 +19,8 @@ TEXT_CODES = {'bold': {'start': '\x1b[1m', 'end': '\x1b[24m'}} class TextCodesStripper: - keys = [re.escape(v['start']) for k,v in TEXT_CODES.iteritems()] - keys += [re.escape(v['end']) for k,v in TEXT_CODES.iteritems()] + keys = [re.escape(v['start']) for k,v in TEXT_CODES.items()] + keys += [re.escape(v['end']) for k,v in TEXT_CODES.items()] pattern = re.compile("|".join(keys)) @staticmethod 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 07753fda..29b6ba58 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,5 +1,5 @@ from texttable import Texttable -from text_opts import format_text +from .text_opts import format_text class TRexTextTable(Texttable): @@ -22,9 +22,9 @@ 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(format_text(header, 'cyan', 'underline') + "\n") - print (texttable_obj.draw() + "\n").encode('utf-8') + print((texttable_obj.draw() + "\n").encode('utf-8')) if __name__ == "__main__": pass -- cgit