From 92ce7cb7c7c9961690e9e22ddb2945b2145193c5 Mon Sep 17 00:00:00 2001 From: Jeff Quast Date: Mon, 24 Nov 2014 20:55:56 -0800 Subject: py3 compatibility for display-terminalinfo.py --- tools/display-terminalinfo.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/display-terminalinfo.py b/tools/display-terminalinfo.py index b3aca73..5689ac8 100755 --- a/tools/display-terminalinfo.py +++ b/tools/display-terminalinfo.py @@ -92,10 +92,9 @@ CTLCHAR_INDEX = { } - def display_bitmask(kind, bitmap, value): """ Display all matching bitmask values for ``value`` given ``bitmap``. """ - col1_width = max(map(len, bitmap.keys() + [kind])) + col1_width = max(map(len, list(bitmap.keys()) + [kind])) col2_width = 7 FMT = '{name:>{col1_width}} {value:>{col2_width}} {description}' print(FMT.format(name=kind, @@ -104,8 +103,8 @@ def display_bitmask(kind, bitmap, value): col1_width=col1_width, col2_width=col2_width)) print('{0} {1} {2}'.format('-' * col1_width, - '-' * col2_width, - '-' * max(map(len, bitmap.values())))) + '-' * col2_width, + '-' * max(map(len, bitmap.values())))) for flag_name, description in bitmap.items(): try: bitmask = getattr(termios, flag_name) @@ -133,8 +132,8 @@ def display_ctl_chars(index, cc): col1_width=col1_width, col2_width=col2_width)) print('{0} {1} {2}'.format('-' * col1_width, - '-' * col2_width, - '-' * 10)) + '-' * col2_width, + '-' * 10)) for index_name, name in index.items(): try: index = getattr(termios, index_name) -- cgit v1.2.1