diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-08-12 15:28:19 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-08-12 15:28:19 +0200 |
commit | 7e9cfd497fe1869f008baa1f6edd5d9a2edee017 (patch) | |
tree | 8041b03ab9c514847e78075bd2186673162acfd5 | |
parent | c7a5d4cbf08ad3caf1aac8ff6db44833f5295ada (diff) | |
download | pyserial-git-7e9cfd497fe1869f008baa1f6edd5d9a2edee017.tar.gz |
miniterm: tweak filters (allow BS, TAB)
-rw-r--r-- | serial/tools/miniterm.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/serial/tools/miniterm.py b/serial/tools/miniterm.py index 111748a..9c6b4fb 100644 --- a/serial/tools/miniterm.py +++ b/serial/tools/miniterm.py @@ -213,7 +213,7 @@ class LF(Transform): class NoTerminal(Transform): """remove typical terminal control codes from input""" def input(self, text): - return ''.join(t if t >= ' ' or t in '\r\n' else unichr(0x2400 + ord(t)) for t in text) + return ''.join(t if t >= ' ' or t in '\r\n\b\t' else unichr(0x2400 + ord(t)) for t in text) echo = input @@ -235,11 +235,11 @@ class HexDump(Transform): class Printable(Transform): - """Show decimal code for all non-ASCII characters and control codes""" + """Show decimal code for all non-ASCII characters and most control codes""" def input(self, text): r = [] for t in text: - if ' ' <= t < '\x7f' or t in '\r\n': + if ' ' <= t < '\x7f' or t in '\r\n\b\t': r.append(t) else: r.extend(unichr(0x2080 + ord(d) - 48) for d in '{:d}'.format(ord(t))) |