summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2014-11-24 20:55:56 -0800
committerJeff Quast <contact@jeffquast.com>2014-11-24 20:55:56 -0800
commit92ce7cb7c7c9961690e9e22ddb2945b2145193c5 (patch)
treeb1d557ad9e2f13899ce606c822d52afd8faf35ba /tools
parent1e51c127553ce617fdacbbb2f4cc99271c562b88 (diff)
downloadpexpect-git-92ce7cb7c7c9961690e9e22ddb2945b2145193c5.tar.gz
py3 compatibility for display-terminalinfo.py
Diffstat (limited to 'tools')
-rwxr-xr-xtools/display-terminalinfo.py11
1 files changed, 5 insertions, 6 deletions
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)